/* ============================================================
   Westin Digital AB — styles.css
   Redaktionell/schweizisk riktning: papper, bläck, en accent.
   ============================================================ */

:root {
  --paper: #F5F2EC;
  --paper-raised: #EFEBE2;
  --ink: #16140F;
  --ink-70: rgba(22, 20, 15, 0.72);
  --ink-50: rgba(22, 20, 15, 0.52);
  --hairline: rgba(22, 20, 15, 0.16);
  --hairline-soft: rgba(22, 20, 15, 0.09);
  --accent: #D9430D;
  --accent-deep: #B93A0C;
  --paper-on-ink: #F5F2EC;
  --hairline-on-ink: rgba(245, 242, 236, 0.22);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Archivo", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  --header-h: 72px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--paper); }

img, svg { display: block; max-width: 100%; }

.container {
  width: min(1360px, 100% - clamp(40px, 6vw, 96px));
  margin-inline: auto;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

em {
  font-style: italic;
  font-weight: 340;
}

/* ---------- Reveal on scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.9s var(--ease) var(--delay, 0s),
    transform 0.9s var(--ease) var(--delay, 0s);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

.line { display: block; overflow: hidden; }
.line-inner {
  display: block;
  transform: translateY(112%);
  transition: transform 1.1s var(--ease);
}
.line:nth-child(2) .line-inner { transition-delay: 0.12s; }
.lines-visible .line-inner { transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 900;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.site-header.scrolled { border-bottom-color: var(--hairline); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.brand-dot { fill: var(--accent); }

.site-nav { display: flex; gap: 34px; }
.nav-link {
  color: var(--ink-70);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 3px;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.35s var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--ink); }
.nav-link:hover::after, .nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.header-right { display: flex; align-items: center; gap: 28px; }
.header-cta {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 3px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.header-cta:hover { color: var(--accent); border-color: var(--accent); }
.header-cta .arrow { display: inline-block; transition: transform 0.3s var(--ease); }
.header-cta:hover .arrow { transform: translateX(4px); }

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 0;
}

/* ---------- Knappar & länkar ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 17px 34px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.link-arrow {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 3px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Sektioner ---------- */
.section { padding: clamp(90px, 11vw, 150px) 0; }

.section-head { margin-bottom: clamp(48px, 6vw, 84px); max-width: 880px; }
.section-label {
  display: block;
  color: var(--accent);
  margin-bottom: 26px;
}
.section-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  font-weight: 420;
  line-height: 1.04;
  letter-spacing: -0.015em;
}
.section-sub {
  margin-top: 22px;
  max-width: 560px;
  color: var(--ink-70);
  font-size: 1.05rem;
}

/* ---------- Hero ---------- */
.hero {
  padding-top: calc(var(--header-h) + clamp(48px, 8vh, 96px));
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(40px, 6vh, 72px);
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--ink-50);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 18px;
  margin-bottom: clamp(36px, 5vh, 64px);
}
.hero-meta-right { color: var(--ink-70); }

.hero-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(3rem, 8.6vw, 8rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.02em;
  max-width: 18ch;
}
.hero-title em { color: var(--accent); font-weight: 340; }

.hero-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  margin-top: clamp(36px, 5vh, 60px);
}
.hero-sub {
  max-width: 470px;
  color: var(--ink-70);
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-shrink: 0;
}

.hero-figure {
  border-top: 1px solid var(--hairline);
  padding: 0;
}
.route-svg { width: 100%; height: clamp(140px, 22vw, 260px); }

.route-grid path { stroke: var(--hairline-soft); stroke-width: 1; }
.route-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 2.4s var(--ease) 0.5s forwards;
}
.route-future {
  fill: none;
  stroke: var(--ink-50);
  stroke-width: 1.25;
  stroke-dasharray: 3 7;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.wp { fill: var(--ink); }
.wp-open { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.route-marker { fill: var(--accent); }
.mono-svg text {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  fill: var(--ink-50);
}

/* ---------- Ticker ---------- */
.ticker {
  overflow: hidden;
  border-block: 1px solid var(--hairline);
  padding: clamp(18px, 2.4vw, 30px) 0;
}
.ticker-track {
  display: flex;
  align-items: center;
  gap: clamp(28px, 3vw, 48px);
  width: max-content;
  white-space: nowrap;
  animation: ticker 46s linear infinite;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(2.2rem, 4.6vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
}
@keyframes ticker { to { transform: translateX(-50%); } }
.t-solid { color: var(--ink); }
.t-outline {
  color: transparent;
  -webkit-text-stroke: 1px var(--ink-50);
  font-style: italic;
}
.t-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ---------- Tjänster: rader ---------- */
.service-list { border-top: 1px solid var(--hairline); }
.service-row {
  display: grid;
  grid-template-columns: 90px 1.05fr 1.35fr 70px;
  gap: clamp(20px, 3vw, 48px);
  align-items: start;
  padding: clamp(30px, 3.6vw, 52px) 0;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: background 0.3s ease;
}
.service-row:hover { background: var(--paper-raised); }
.service-index { color: var(--ink-50); padding-top: 10px; }
.service-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
  font-weight: 420;
  line-height: 1.08;
  letter-spacing: -0.01em;
  transition: transform 0.4s var(--ease);
}
.service-row:hover .service-title { transform: translateX(10px); }
.service-body p { color: var(--ink-70); max-width: 520px; }
.service-tags {
  display: block;
  margin-top: 16px;
  color: var(--ink-50);
  letter-spacing: 0.08em;
}
.service-arrow {
  justify-self: end;
  align-self: center;
  font-size: 1.5rem;
  color: var(--ink-50);
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.3s ease, transform 0.4s var(--ease), color 0.3s ease;
}
.service-row:hover .service-arrow {
  opacity: 1;
  transform: none;
  color: var(--accent);
}

/* ---------- Siffror ---------- */
.stats { padding: clamp(56px, 7vw, 96px) 0; }
.stats .container { border-block: 1px solid var(--hairline); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  padding: clamp(32px, 3.6vw, 52px) clamp(20px, 2.4vw, 40px);
  border-left: 1px solid var(--hairline);
}
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-value {
  display: block;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}
.stat-label { color: var(--ink-50); }

/* ---------- Om oss ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(48px, 6vw, 110px);
  align-items: start;
}
.about-lead {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}
.about-text > p:not(.about-lead) {
  color: var(--ink-70);
  max-width: 560px;
}

.about-list {
  list-style: none;
  margin-top: clamp(36px, 4vw, 56px);
  border-top: 1px solid var(--hairline);
}
.about-list li {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 1rem;
}
.li-index { color: var(--accent); }

.about-figure {
  border: 1px solid var(--hairline);
  background: var(--paper);
  position: sticky;
  top: calc(var(--header-h) + 32px);
}
.about-figure svg { width: 100%; height: auto; padding: 8px; }
.fig-grid path { stroke: var(--hairline-soft); stroke-width: 1; }
.fig-cross path { stroke: var(--ink-50); stroke-width: 1; }
.fig-ring { fill: none; stroke: var(--hairline); stroke-width: 1; }
.fig-ring-dash { stroke-dasharray: 3 6; }
.fig-route {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.about-figure.is-visible .fig-route { animation: draw 2.2s var(--ease) 0.4s forwards; }
.fig-pos { fill: var(--accent); }
.about-figure figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-top: 1px solid var(--hairline);
  color: var(--ink-50);
}

/* ---------- Arbetssätt ---------- */
.timeline {
  position: relative;
  max-width: 820px;
  padding-left: clamp(36px, 5vw, 64px);
}
.timeline-track {
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--hairline);
}
.timeline-progress {
  display: block;
  width: 100%;
  height: 0%;
  background: var(--accent);
  transition: height 0.15s linear;
}
.step {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: clamp(20px, 3vw, 48px);
  padding: clamp(28px, 3.4vw, 44px) 0;
  border-bottom: 1px solid var(--hairline);
}
.step:first-of-type { border-top: 1px solid var(--hairline); }
.step-num { color: var(--accent); padding-top: 8px; }
.step-body h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  font-weight: 420;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.step-body p { color: var(--ink-70); max-width: 560px; }

/* ---------- Kontakt (bläcksektion) ---------- */
.contact {
  background: var(--ink);
  color: var(--paper-on-ink);
  padding: clamp(90px, 11vw, 150px) 0 0;
}
.contact .section-label { color: var(--accent); }
.contact .section-title { color: var(--paper-on-ink); }
.contact .section-title em { color: var(--accent); }

.contact-grid {
  padding-bottom: clamp(80px, 9vw, 130px);
}
.contact-text p {
  color: rgba(245, 242, 236, 0.66);
  max-width: 420px;
  font-size: 1.05rem;
}
.contact-mail {
  display: inline-block;
  margin-top: 34px;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--paper-on-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 6px;
  transition: color 0.25s ease;
}
.contact-mail:hover { color: var(--accent); }

/* ---------- Sidfot ---------- */
.site-footer {
  border-top: 1px solid var(--hairline-on-ink);
  padding: clamp(40px, 5vw, 64px) 0 40px;
}
.footer-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: clamp(36px, 5vw, 60px);
}
.footer-wordmark {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.footer-nav { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-nav a {
  color: rgba(245, 242, 236, 0.6);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s ease;
}
.footer-nav a:hover { color: var(--paper-on-ink); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: rgba(245, 242, 236, 0.38);
  border-top: 1px solid var(--hairline-on-ink);
  padding-top: 22px;
}

/* ============================================================
   Responsivt
   ============================================================ */
@media (max-width: 1080px) {
  .service-row { grid-template-columns: 60px 1fr; }
  .service-body { grid-column: 2; }
  .service-arrow { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .about-figure { position: static; max-width: 560px; }
}

@media (max-width: 820px) {
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--paper);
    border-top: 1px solid var(--hairline);
    flex-direction: column;
    gap: 0;
    padding: clamp(24px, 6vw, 48px) clamp(20px, 5vw, 48px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 890;
  }
  body.nav-open .site-nav { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .site-nav .nav-link {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--ink);
    padding: 20px 0;
    border-bottom: 1px solid var(--hairline);
  }
  .site-nav .nav-link::after { display: none; }
  .menu-toggle { display: block; }
  .header-cta { display: none; }

  .hero { min-height: auto; }
  .hero-foot { flex-direction: column; align-items: flex-start; gap: 32px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat { border-left: 0; padding-left: 0; border-top: 1px solid var(--hairline-soft); }
  .stat:nth-child(-n+2) { border-top: 0; }
  .step { grid-template-columns: 1fr; gap: 10px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}

@media (max-width: 520px) {
  .container { width: min(1360px, 100% - 40px); }
  .stats-grid { grid-template-columns: 1fr; }
  .stat { border-top: 1px solid var(--hairline-soft); }
  .stat:first-child { border-top: 0; }
  .hero-meta { flex-direction: column; gap: 6px; }
  .hero-actions { flex-wrap: wrap; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal], .line-inner { opacity: 1 !important; transform: none !important; }
  .route-line, .fig-route { stroke-dashoffset: 0 !important; animation: none !important; }
  .route-marker { display: none; }
  .ticker-track { animation: none; }
}
