/* =========================================================================
   Nicola Klemenc — portfolio (v3: modern / polished)
   Schibsted Grotesk (display) + Hanken Grotesk (body), self-hosted.
   Warm-neutral paper, near-black ink, a single vermilion accent. Soft corners.
   ========================================================================= */

:root {
  /* ---- color ---- */
  --bg:           #f7f6f3;
  --surface:      #ffffff;
  --surface-2:    #f1efe9;
  --ink:          #17161c;
  --ink-soft:     #555460;
  --ink-faint:    #6b6873;   /* darkened for AA — ~4.6:1 on paper */
  --line:         #ece8e1;
  --line-strong:  #d8d3ca;
  --accent:       #c4452f;   /* primary orange — AA-safe for white text (~4.8:1) */
  --accent-strong:#e2543b;   /* brighter — decorative (non-text) only */
  --accent-deep:  #a83a27;   /* hover / pressed */
  --accent-tint:  #fbe9e4;
  /* secondary = neutral grey only (no colour); orange is the single accent */

  /* ---- type ---- */
  --display: "Schibsted Grotesk", system-ui, sans-serif;
  --sans:    "Hanken Grotesk", system-ui, -apple-system, sans-serif;

  --fs-eyebrow: 0.8rem;
  --fs-body:    1.075rem;
  --fs-small:   0.95rem;
  --fs-lead:    clamp(2.1rem, 1.1rem + 4vw, 3.6rem);
  --fs-h2:      clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
  --fs-h3:      1.18rem;

  /* ---- space / shape ---- */
  --sp-xs: 0.5rem;  --sp-s: 0.9rem;   --sp-m: 1.35rem;
  --sp-l: 2.25rem;  --sp-xl: 4rem;    --sp-2xl: 6rem;

  --maxw: 62rem;
  --r:    12px;
  --r-sm: 9px;

  --shadow-sm: 0 1px 2px rgba(23,22,28,0.04), 0 2px 6px rgba(23,22,28,0.05);
  --shadow-md: 0 10px 34px -12px rgba(23,22,28,0.16);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); }
svg { display: block; }

/* layout */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.75rem; }
.band { background: var(--surface-2); }
.band > .wrap { padding-block: var(--sp-xl); }
.section-pad { padding-block: var(--sp-xl); }

/* =========================================================================
   Header
   ========================================================================= */
.site-head { position: sticky; top: 0; z-index: 20; background: rgba(247,246,243,0.82); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--line); }
.head-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 0.95rem; }
.logo { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo-mark {
  font-family: var(--display); font-weight: 700; font-size: 0.92rem;
  color: #fff; background: var(--accent);
  display: inline-grid; place-items: center; width: 2.05rem; height: 2.05rem;
  border-radius: var(--r-sm);
  transition: transform 0.18s ease, background 0.18s ease;
}
.logo:hover .logo-mark { background: var(--accent-deep); transform: rotate(-4deg); }
.logo-word { font-family: var(--display); font-weight: 600; font-size: 1.04rem; letter-spacing: -0.01em; }

.lang-toggle {
  font-family: var(--sans); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink-soft); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 0.34rem 0.8rem; cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.lang-toggle:hover { color: var(--accent); border-color: var(--accent); box-shadow: var(--shadow-sm); }

/* =========================================================================
   Hero
   ========================================================================= */
.hero { padding-block: var(--sp-2xl) var(--sp-xl); }
.eyebrow {
  font-size: var(--fs-eyebrow); text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--ink-faint); font-weight: 600; margin-bottom: var(--sp-m);
}
.lead { font-size: var(--fs-lead); font-weight: 600; max-width: 17ch; margin-bottom: var(--sp-s); }
.hero-sub { font-family: var(--display); font-size: clamp(1.55rem, 0.8rem + 2.6vw, 2.35rem); font-weight: 500; line-height: 1.2; letter-spacing: -0.015em; color: var(--ink); max-width: 28ch; margin-bottom: var(--sp-m); }
.intro { font-size: 1.18rem; color: var(--ink-soft); max-width: 52ch; margin-bottom: var(--sp-l); line-height: 1.55; }

.cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--sans); font-weight: 600; font-size: 1rem;
  color: #fff; background: var(--accent);
  padding: 0.8rem 1.5rem; border-radius: 999px; border: 0; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.18s ease, transform 0.16s ease, box-shadow 0.18s ease;
}
.cta:hover { color: #fff; background: var(--accent-deep); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cta:active { transform: translateY(0); }
.cta span[aria-hidden] { transition: transform 0.18s ease; }
.cta:hover span[aria-hidden] { transform: translateX(3px); }

/* =========================================================================
   Section titles
   ========================================================================= */
.section-title { font-size: var(--fs-h2); margin-bottom: var(--sp-l); }
.section-title::after { content: ""; display: block; width: 2.5rem; height: 3px; background: var(--accent-strong); border-radius: 2px; margin-top: 0.7rem; }

/* =========================================================================
   Capabilities — airy cards
   ========================================================================= */
.cap-grid { list-style: none; counter-reset: cap; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-m); }
.cap-grid li {
  counter-increment: cap; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: var(--sp-l); box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cap-grid li:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cap-grid li::before {
  content: counter(cap, decimal-leading-zero);
  font-family: var(--display); font-weight: 600; font-size: 0.85rem; color: var(--ink-faint);
  display: block; margin-bottom: 0.8rem;
}
.cap-grid h3 { font-size: var(--fs-h3); margin-bottom: 0.55rem; }
.cap-grid p { color: var(--ink-soft); font-size: var(--fs-small); }

/* =========================================================================
   Selected work
   ========================================================================= */
.work { padding-block: var(--sp-xl); }
.work-blurb { font-size: 1.22rem; color: var(--ink-soft); max-width: 56ch; margin-bottom: var(--sp-l); line-height: 1.55; }
.cta-ghost { color: var(--accent); background: transparent; border: 1.5px solid var(--accent); box-shadow: none; }
.cta-ghost:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.work-list { list-style: none; margin: 0; padding: 0; }
.work-row {
  display: grid; grid-template-columns: 12rem 1fr 10rem 3rem;
  gap: 1.25rem; align-items: baseline;
  padding: var(--sp-m) var(--sp-s);
  border-radius: var(--r-sm);
  border-bottom: 1px solid var(--line);
  transition: background 0.18s ease;
}
.work-row:last-child { border-bottom: 0; }
.work-row:hover { background: var(--surface); }
.work-client { font-family: var(--display); font-weight: 600; font-size: 1.02rem; }
.work-region { color: var(--ink-faint); font-weight: 500; }
.work-desc { color: var(--ink-soft); font-size: var(--fs-small); }
.work-tech { font-size: 0.82rem; color: var(--accent); font-weight: 600; }
.work-year { font-size: 0.85rem; color: var(--ink-faint); text-align: right; font-variant-numeric: tabular-nums; }
.work-note { margin-top: var(--sp-l); font-size: 0.9rem; color: var(--ink-faint); font-style: italic; }

/* =========================================================================
   Agency callout
   ========================================================================= */
.agency {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--r); padding: var(--sp-l); box-shadow: var(--shadow-sm);
}
.agency-tag { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-faint); font-weight: 600; display: block; margin-bottom: 0.55rem; }
.agency p { color: var(--ink-soft); font-size: var(--fs-small); }
.agency strong { color: var(--ink); font-weight: 600; }

/* =========================================================================
   Contact
   ========================================================================= */
.contact-sub { color: var(--ink-soft); margin-bottom: var(--sp-l); max-width: 48ch; }
.form { display: grid; gap: var(--sp-m); max-width: 40rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-m); }
.form label {
  display: grid; gap: 0.4rem;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-faint); font-weight: 600;
}
.form input, .form textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 0.72rem 0.9rem; width: 100%;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
.form textarea { resize: vertical; }
.form .cta { justify-self: start; margin-top: 0.25rem; }
.hp { position: absolute; left: -9999px; width: 0; height: 0; opacity: 0; }
.form-status { font-size: var(--fs-small); min-height: 1.2em; margin: 0; }
.form-status.note { color: var(--ink-soft); }
.form-status.ok   { color: var(--accent-deep); font-weight: 600; }
.form-status.err  { color: #b3261e; }

.alt-contact { margin-top: var(--sp-l); color: var(--ink-faint); font-size: var(--fs-small); }
.alt-contact a { font-weight: 600; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-foot { background: var(--surface-2); border-top: 1px solid var(--line); margin-top: var(--sp-2xl); }
.site-foot .wrap { display: flex; justify-content: space-between; align-items: center; padding-block: var(--sp-l); color: var(--ink-faint); font-size: 0.88rem; }

/* =========================================================================
   Motion
   ========================================================================= */
@media (prefers-reduced-motion: no-preference) {
  .hero > * { animation: rise 0.65s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero > *:nth-child(1) { animation-delay: 0.04s; }
  .hero > *:nth-child(2) { animation-delay: 0.12s; }
  .hero > *:nth-child(3) { animation-delay: 0.20s; }
  .hero > *:nth-child(4) { animation-delay: 0.28s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 680px) {
  .cap-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .work-row { grid-template-columns: 1fr; gap: 0.3rem; padding-inline: 0; }
  .work-year { text-align: left; }
  .site-foot .wrap { flex-direction: column; gap: 0.4rem; align-items: flex-start; }
}

/* =========================================================================
   Styleguide helpers (.sg-*)
   ========================================================================= */
.sg-section { padding-block: var(--sp-xl); border-bottom: 1px solid var(--line); }
.sg-h { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-faint); font-weight: 600; margin-bottom: var(--sp-m); }
.sg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: var(--sp-m); }
.sg-swatch { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; font-size: 0.78rem; background: var(--surface); box-shadow: var(--shadow-sm); }
.sg-chip { height: 4.5rem; }
.sg-meta { padding: 0.55rem 0.65rem; display: grid; gap: 0.1rem; }
.sg-meta span { color: var(--ink-faint); }
.sg-logos { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-xl); }
.sg-mark-lg { font-family: var(--display); font-weight: 700; color: #fff; background: var(--accent); display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: var(--r); font-size: 1.5rem; }
.sg-type-row { display: flex; align-items: baseline; gap: 1rem; padding-block: 0.55rem; border-bottom: 1px dashed var(--line); }
.sg-type-row small { color: var(--ink-faint); font-size: 0.72rem; min-width: 5rem; }
