/* Single Page Portfolio CSS - AK47-F Modern Design */

/* Custom Color Palette */
:root {
  --color-dark: #120700;
  --color-primary: #ff7300;
  --color-secondary: #ffc286;
  --color-accent: #ffc400;
  --color-white: #ffffff;
  --color-black: #000000;

  /* Timeline phase colors (6 phases) */
  --timeline-phase-0: #e2cd79; /* Brukeranalyse */
  --timeline-phase-1: #b0df3a; /* Konseptutvikling */
  --timeline-phase-2: #50da00; /* Prototype */
  --timeline-phase-3: #00cf9f; /* Finjustering */
  --timeline-phase-4: #00b9da; /* Validering */
  --timeline-phase-5: #4876bb; /* Ferdigstilling */
}

/* Single Page Body - With Parallax Scrolling */
.single-page-body {
  font-family:
    'Readex Pro',
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  margin: 0;
  padding: 0;
  height: auto;
  width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

/* Right-side vertical navigation */
.side-nav {
  position: fixed;
  top: 50%;
  right: 1.25rem;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.side-nav__content {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.side-nav__toggle {
  display: none;
  border: none;
  background: transparent;
  color: var(--color-white);
  padding: 0;
  cursor: pointer;
}

.side-nav__toggle-icon {
  display: block;
  width: 18px;
  height: 18px;
}

.side-nav__link {
  color: var(--color-white);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  opacity: 0.9;
}

.side-nav__link:hover {
  opacity: 1;
}

.side-nav__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
  margin: 0.25rem 0;
}

/* Language switch (UI only) */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-white);
  user-select: none;
}

.lang-switch__label {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.85;
}

.lang-switch__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lang-switch__track {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 3px;
}

.lang-switch__thumb {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--color-primary);
  transform: translateX(0);
  transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-switch:focus-within .lang-switch__track {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.lang-switch__input:checked + .lang-switch__track .lang-switch__thumb {
  transform: translateX(18px);
}

/* Hero (redesign) */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh; /* NOTE: mobile-safe viewport unit */
  overflow: hidden;
  display: grid;
  align-items: end;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #000;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* NOTE: ensures full-screen cover without exceptions */
  object-position: center;
  filter: saturate(0.8);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.78),
    rgba(0, 0, 0, 0.15) 60%,
    rgba(0, 0, 0, 0.05)
  );
}

.hero-triangle-logo {
  position: absolute;
  top: 1.25rem;
  /* Align with the centered hero content container (same left edge as .hero-content padding). */
  left: max(1.25rem, calc((100vw - 70rem) / 2));
  z-index: 2;
  height: 14px;
  width: auto;
  pointer-events: none; /* Decorative mark; does not block navigation/inputs */
  opacity: 0.95;
}

.hero-logo-mark {
  height: 100%;
  width: auto;
  display: block;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 6rem 1.25rem 2.5rem 1.25rem;
  max-width: 70rem;
  width: 100%;
  margin: 0 auto;
  color: var(--color-white);
}

.hero-title {
  margin: 0 0 1rem 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  text-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.hero-subtitle {
  margin: 0;
  max-width: 48rem;
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.9;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.hero-cta {
  display: inline-block;
  margin-top: 1.75rem;
  color: var(--color-white);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: #000000;
  border: none;
  border-radius: 14px;
  padding: 1rem 1.25rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.hero-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.32);
}

.hero-cta:active {
  transform: translateY(0);
}

/* White section (template) */
.section {
  position: relative;
  width: 100%;
}

.section--white {
  background: var(--color-white);
  color: var(--color-dark);
}

.section-inner {
  max-width: 70rem;
  margin: 0 auto;
  padding: 4rem 1.25rem;
}

.section-title {
  margin: 0 0 0.75rem 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.section-lead {
  margin: 0 0 2rem 0;
  max-width: 48rem;
  line-height: 1.7;
  opacity: 0.9;
}

/* Spacing helper for content added after grids */
.section-lead--after-grid {
  margin-top: 2rem;
}

/* Section header helpers */
.section-head {
  position: relative;
}

.section-kicker {
  margin: 0 0 0.75rem 0;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.service-card {
  grid-column: span 12;
  border: 1px solid rgba(31, 31, 31, 0.12);
  border-radius: 12px;
  padding: 1.25rem;
  background: var(--color-white);
}

/* Note: highlights Produktdesign card with primary border stroke */
.service-card--primary-stroke {
  border-color: var(--color-primary);
}

.service-title {
  margin: 0 0 0.5rem 0;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.service-text {
  margin: 0;
  line-height: 1.6;
  opacity: 0.85;
}

/* About page team section */
.about-team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.about-team-card {
  margin: 0;
  border: 1px solid rgba(31, 31, 31, 0.12);
  background: var(--color-white);
}

.about-team-card__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  background: rgba(31, 31, 31, 0.05);
}

.about-team-card__meta {
  padding: 0.9rem 1rem 1rem;
}

.about-team-card__name {
  margin: 0 0 0.25rem 0;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.about-team-card__role {
  margin: 0;
  line-height: 1.5;
  opacity: 0.8;
}

/* Features section */
.section--features .section-inner {
  padding-bottom: 2rem;
}

.feature-banner {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  margin-bottom: 2rem;
}

.feature-banner__img {
  display: block;
  width: 100%;
  max-height: 62vh;
  object-fit: cover;
  object-position: center;
  background: rgba(31, 31, 31, 0.04);
}

.feature-points {
  display: grid;
  gap: 2rem;
  max-width: 48rem;
}

.feature-point {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 1.2rem; /* Icon-to-text spacing */
  line-height: 1.6;
}

.feature-point__text {
  opacity: 0.9;
}

/* Note: utility for highlighting specific text in primary color */
.text-primary {
  color: var(--color-primary);
}

.feature-icon {
  flex: 0 0 auto;
  /* ~= 2 text heights (line-height: 1.6) for a strong visual rhythm */
  width: 3.2em;
  height: 3.2em;
  display: block;
  margin-top: 0;
}

@media (max-width: 1024px) {
  .feature-banner__img {
    max-height: 48vh;
  }
}

/* Timeline section */
.timeline {
  margin-top: 2rem;
}

.timeline-anchors {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  margin-bottom: 0.9rem;
}

.timeline-anchor {
  font-weight: 600;
  letter-spacing: -0.01em;
  opacity: 0.85;
}

.timeline-anchor--time {
  opacity: 0.9;
}

.timeline-track-wrap {
  position: relative;
  padding-top: 2.75rem;
}

.timeline-track {
  position: relative;
  height: 36px;
  border-radius: 999px;
  background: rgba(31, 31, 31, 0.08);
  border: 1px solid rgba(31, 31, 31, 0.12);
  overflow: hidden;
}

.timeline-labels {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2.5rem;
  pointer-events: none;
}

.timeline-segments {
  position: absolute;
  inset: 0;
  display: flex;
}

.timeline-segment {
  height: 100%;
  width: 0%;
}

.timeline-segment[data-segment='0'] {
  background: var(--timeline-phase-0); /* Brukeranalyse */
}
.timeline-segment[data-segment='1'] {
  background: var(--timeline-phase-1); /* Konseptutvikling */
}
.timeline-segment[data-segment='2'] {
  background: var(--timeline-phase-2); /* Prototype */
}
.timeline-segment[data-segment='3'] {
  background: var(--timeline-phase-3); /* Finjustering */
}
.timeline-segment[data-segment='4'] {
  background: var(--timeline-phase-4); /* Validering */
}
.timeline-segment[data-segment='5'] {
  background: var(--timeline-phase-5); /* Ferdigstilling */
}

.timeline-handles {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  pointer-events: none;
}

.timeline-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--color-white);
  border: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
  cursor: ew-resize;
  touch-action: none;
}

.timeline-handle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.timeline-handle-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-dark);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(31, 31, 31, 0.12);
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
}

.timeline-summary {
  margin-top: 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(31, 31, 31, 0.12);
  background: rgba(31, 31, 31, 0.03);
  padding: 1.25rem;
}

.timeline-summary__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.75rem;
  margin: 1.5rem 0 2rem 0;
}

.timeline-summary-item {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

.timeline-summary-item__name {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.timeline-summary-item__value {
  opacity: 0.8;
}

/* Match summary text color to timeline segments */
.timeline-summary-item[data-phase-summary='0'] .timeline-summary-item__name,
.timeline-summary-item[data-phase-summary='0'] .timeline-summary-item__value {
  color: var(--timeline-phase-0);
  opacity: 1;
}
.timeline-summary-item[data-phase-summary='1'] .timeline-summary-item__name,
.timeline-summary-item[data-phase-summary='1'] .timeline-summary-item__value {
  color: var(--timeline-phase-1);
  opacity: 1;
}
.timeline-summary-item[data-phase-summary='2'] .timeline-summary-item__name,
.timeline-summary-item[data-phase-summary='2'] .timeline-summary-item__value {
  color: var(--timeline-phase-2);
  opacity: 1;
}
.timeline-summary-item[data-phase-summary='3'] .timeline-summary-item__name,
.timeline-summary-item[data-phase-summary='3'] .timeline-summary-item__value {
  color: var(--timeline-phase-3);
  opacity: 1;
}
.timeline-summary-item[data-phase-summary='4'] .timeline-summary-item__name,
.timeline-summary-item[data-phase-summary='4'] .timeline-summary-item__value {
  color: var(--timeline-phase-4);
  opacity: 1;
}
.timeline-summary-item[data-phase-summary='5'] .timeline-summary-item__name,
.timeline-summary-item[data-phase-summary='5'] .timeline-summary-item__value {
  color: var(--timeline-phase-5);
  opacity: 1;
}

@media (max-width: 768px) {
  .timeline-handle {
    width: 22px;
    height: 22px;
  }

  .timeline-summary__grid {
    grid-template-columns: 1fr;
  }
}

/* Inquiry form */
.inquiry-form {
  margin-top: 2rem;
  border-radius: 16px;
  border: none;
  background: rgba(31, 31, 31, 0.03);
  padding: 1.25rem;
}

.inquiry-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.field {
  grid-column: span 12;
}

.field--full {
  margin-top: 1rem;
}

.field__label {
  display: block;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.field__input,
.field__textarea {
  width: 100%;
  /* Prevent padding + borders from overflowing the grid column */
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(31, 31, 31, 0.14);
  background: var(--color-white);
  padding: 0.9rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
}

.field__textarea {
  resize: vertical;
  min-height: 140px;
}

.field__input:focus-visible,
.field__textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.inquiry-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.inquiry-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  color: var(--color-white);
  border: none;
  border-radius: 14px;
  padding: 1rem 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
  cursor: pointer;
}

.inquiry-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.2);
}

.inquiry-cta:active {
  transform: translateY(0);
}

.inquiry-note {
  margin: 0;
  max-width: 52rem;
  line-height: 1.6;
  opacity: 0.85;
}

@media (min-width: 768px) {
  .field {
    grid-column: span 6;
  }
}

/* Projects grid */
.section--projects .section-inner {
  padding-top: 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.projects-sentinel {
  width: 100%;
  height: 1px;
}

.project-tile {
  display: block;
  text-decoration: none;
  color: var(--color-dark);
}

.project-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(31, 31, 31, 0.05);
}

.project-thumb--placeholder {
  background: #e5e7eb;
}

.project-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
  filter: saturate(0.95);
}

.project-meta {
  padding-top: 0.9rem;
}

.project-title {
  margin: 0 0 0.35rem 0;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
  line-height: 1.25;
}

.project-desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.85;
}

.project-tile:hover .project-thumb__img {
  transform: scale(1.06);
}

/* Contact section */
.section--contact .section-inner {
  padding-top: 3rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 60rem;
}

.contact-item {
  display: block;
  margin: 0;
  border: 1px solid rgba(31, 31, 31, 0.12);
  background: rgba(31, 31, 31, 0.02);
  padding: 1rem 1.1rem;
  color: var(--color-dark);
  text-decoration: none;
}

.contact-item__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.35rem;
}

.contact-item__value {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-dark);
}

.contact-link:hover {
  border-color: rgba(255, 115, 0, 0.42);
  background: rgba(255, 115, 0, 0.06);
}

.contact-link:hover .contact-item__value {
  color: var(--color-primary);
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(31, 31, 31, 0.12);
  background: var(--color-white);
}

.site-footer__inner {
  max-width: 70rem;
  margin: 0 auto;
  padding: 1.1rem 1.25rem 1.35rem;
}

.site-footer__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  opacity: 0.75;
}

@media (max-width: 1024px) {
  .about-team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .inquiry-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.9rem;
  }

  .inquiry-note {
    order: 1;
  }

  .inquiry-cta {
    order: 2;
    width: 100%;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .about-team-grid {
    grid-template-columns: 1fr;
  }

  .side-nav {
    --mobile-toggle-size: 1.7rem;
    right: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    transform: translateY(-50%) translateX(calc(100% - var(--mobile-toggle-size)));
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  .side-nav.is-open {
    transform: translateY(-50%) translateX(0);
  }

  .side-nav__content {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.65rem;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
  }

  .side-nav__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--mobile-toggle-size);
    min-height: var(--mobile-toggle-size);
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
  }

  .side-nav__toggle-icon {
    width: 13px;
    height: 13px;
    /* NOTE: collapsed = vertical edge on right side */
    transform: rotate(-90deg);
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  .side-nav.is-open .side-nav__toggle-icon {
    /* NOTE: expanded = vertical edge on left side */
    transform: rotate(90deg);
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Mobile: Adjust text container width */
@media (max-width: 768px) {
  .hero-content {
    padding-top: 5rem;
  }
}

@media (min-width: 768px) {
  .service-card {
    grid-column: span 4;
  }
}

/* Remove corner rounding on rectangles/buttons */
.hero-cta,
.inquiry-cta,
.side-nav,
.inquiry-form,
.field__input,
.field__textarea,
.project-thumb,
.service-card {
  border-radius: 0;
}

/* Smooth Transitions */
* {
  transition-property:
    color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow,
    transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Focus Styles for Accessibility */
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Custom Scrollbar (if needed) */
::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for Firefox */
html {
  scrollbar-width: none;
}

/* Enable smooth scrolling */
body,
html {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  width: 100%;
}

/* Print Styles */
@media print {
  .single-page-body {
    overflow: visible;
    height: auto;
    width: auto;
  }

  .background-image {
    background-attachment: scroll;
  }
}
