/* ==========================================================================
   nicecom — base
   Swiss Modernism 2.0, archive flavour. Tokens, reset, primitives.
   Shared by the company site and the web business cards.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens
   Brand blue is sampled from the logo: #6AA3BA. It only clears 2.5:1 on
   paper, so it is a *graphic* colour — rules, fills, marks. Text that needs
   to be blue uses --brand-deep (5.0:1). On ink backgrounds --brand hits
   6.4:1 and can be used freely.
   -------------------------------------------------------------------------- */
:root {
  --paper:       #F7F6F3;
  --paper-2:     #EFEDE8;
  --paper-3:     #E6E3DC;
  --card:        #FFFFFF;

  --ink:         #16181A;
  --ink-2:       #5A5F63;
  /* 4.6:1 on paper. The lighter #767C80 this replaced only made 3.9:1, and
     every place it is used is 11px mono — the last type that can afford it. */
  --ink-3:       #6B7176;

  --rule:        #DDD9D2;
  --rule-soft:   #E8E5DF;

  /* Inverted surfaces (§07, the pivot year, the card's back). Same ladder as
     above, re-measured against --ink: 11.1 / 7.9 / 4.8 : 1. */
  --on-ink:      #C9CDD0;
  --on-ink-2:    #A8AEB2;
  --on-ink-3:    #7E858A;
  --rule-on-ink:      #2C3033;
  --rule-on-ink-2:    #3C4145;

  --brand:       #6AA3BA;
  --brand-deep:  #35708A;
  --brand-wash:  #E9F0F4;
  --rule-wash:   #D3E0E7;   /* hairlines drawn on --brand-wash */

  --focus:       #1F6E8C;

  /* Spacing — 4px base, standard density */
  --s1: 0.25rem;  --s2: 0.5rem;   --s3: 0.75rem;  --s4: 1rem;
  --s5: 1.5rem;   --s6: 2rem;     --s7: 3rem;     --s8: 4rem;
  --s9: 6rem;     --s10: 8rem;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --maxw: 1440px;

  --font-sans: "Archivo", "Pretendard Variable", Pretendard, -apple-system,
               BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo",
               "Malgun Gothic", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo,
               "Courier New", monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  /* Things that enter from off-screen. Exponential, not springy: a real object
     decelerates hard and stops, it does not overshoot and settle back. */
  --ease-pop: cubic-bezier(0.16, 1, 0.3, 1);
  /* The coverflow's swing: quick to leave, long to settle. */
  --ease-flow: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 220ms;
  --dur-slow: 420ms;
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;

  /* Korean has no inter-syllable break opportunity that a reader expects, so
     the default `break-word` splits 남/의 mid-word. keep-all breaks on spaces
     only; break-word is kept as the escape hatch for long URLs. */
  word-break: keep-all;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--brand); color: #fff; }

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* --------------------------------------------------------------------------
   Type primitives
   -------------------------------------------------------------------------- */
.mono {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}

.display {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-wrap: balance;
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Reveal — driven by IntersectionObserver in js. Starts visible so the page
   is readable if scripts never run.
   -------------------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-slow) var(--ease),
              transform var(--dur-slow) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@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;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}
