/* =========================================================
   Apple Design System — Colors & Typography Tokens
   ========================================================= */

/* ---------- Font stack ----------
   NOTE: Apple's SF Pro is a proprietary typeface and is NOT redistributed
   in this design system. On Apple hardware, `-apple-system` resolves to
   SF Pro automatically. Elsewhere we fall back to Inter (closest free
   neutral geometric sans) loaded from Google Fonts in the HTML.

   New York is Apple's serif, bundled in this system at fonts/. It is NOT
   used on apple.com marketing pages (those are SF Pro) — New York is
   intended for editorial / long-form reading contexts (Apple Books, News,
   quotes, pull-outs). Available as --apple-font-serif.
*/

/* New York — four optical sizes + full weight range */
@font-face { font-family: "New York"; src: url("fonts/NewYorkSmall-Regular.otf")  format("opentype"); font-weight: 400; font-style: normal; font-display: swap; size-adjust: 100%; }
@font-face { font-family: "New York"; src: url("fonts/NewYorkSmall-RegularItalic.otf") format("opentype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "New York"; src: url("fonts/NewYorkSmall-Medium.otf")   format("opentype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "New York"; src: url("fonts/NewYorkSmall-Semibold.otf") format("opentype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "New York"; src: url("fonts/NewYorkSmall-Bold.otf")     format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "New York"; src: url("fonts/NewYorkSmall-Heavy.otf")    format("opentype"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "New York"; src: url("fonts/NewYorkSmall-Black.otf")    format("opentype"); font-weight: 900; font-style: normal; font-display: swap; }

/* "New York Large" — display optical, used at ~28px+ for editorial heads */
@font-face { font-family: "New York Large"; src: url("fonts/NewYorkLarge-Regular.otf")  format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "New York Large"; src: url("fonts/NewYorkLarge-Semibold.otf") format("opentype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "New York Large"; src: url("fonts/NewYorkLarge-Bold.otf")     format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "New York Large"; src: url("fonts/NewYorkLarge-Black.otf")    format("opentype"); font-weight: 900; font-style: normal; font-display: swap; }

/* "New York Extra Large" — max display optical, for hero-sized pulled quotes */
@font-face { font-family: "New York XL"; src: url("fonts/NewYorkExtraLarge-Regular.otf")  format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "New York XL"; src: url("fonts/NewYorkExtraLarge-Semibold.otf") format("opentype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "New York XL"; src: url("fonts/NewYorkExtraLarge-Bold.otf")     format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "New York XL"; src: url("fonts/NewYorkExtraLarge-Black.otf")    format("opentype"); font-weight: 900; font-style: normal; font-display: swap; }

:root {
  --apple-font-display:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --apple-font-text:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --apple-font-serif:
    "New York", "New York Large", "New York XL",
    ui-serif, "Iowan Old Style", "Apple Garamond", Georgia, serif;
  --apple-font-serif-display:
    "New York XL", "New York Large", "New York",
    ui-serif, "Iowan Old Style", Georgia, serif;

  /* ---------- Color — Primary ---------- */
  --apple-black: #000000;
  --apple-near-black: #1d1d1f;
  --apple-light-gray: #f5f5f7;
  --apple-white: #ffffff;

  /* ---------- Color — Interactive (the ONLY chromatic hues) ---------- */
  --apple-blue: #0071e3;          /* CTA bg, focus ring */
  --apple-link-blue: #0066cc;     /* links on light bg */
  --apple-bright-blue: #2997ff;   /* links on dark bg */

  /* ---------- Color — Text ---------- */
  --apple-text-on-light: #1d1d1f;
  --apple-text-on-dark: #ffffff;
  --apple-text-secondary-light: rgba(0, 0, 0, 0.8);
  --apple-text-tertiary-light: rgba(0, 0, 0, 0.48);

  /* ---------- Color — Dark surfaces ---------- */
  --apple-surface-dark-1: #272729;
  --apple-surface-dark-2: #262628;
  --apple-surface-dark-3: #28282a;
  --apple-surface-dark-4: #2a2a2d;
  --apple-surface-dark-5: #242426;

  /* ---------- Color — Button states ---------- */
  --apple-btn-active: #ededf2;
  --apple-btn-default-light: #fafafc;
  --apple-overlay: rgba(210, 210, 215, 0.64);
  --apple-hover-white-32: rgba(255, 255, 255, 0.32);

  /* ---------- Shadow ---------- */
  --apple-shadow-card: rgba(0, 0, 0, 0.22) 3px 5px 30px 0px;

  /* ---------- Radii ---------- */
  --apple-radius-micro: 5px;
  --apple-radius-standard: 8px;
  --apple-radius-comfortable: 11px;
  --apple-radius-large: 12px;
  --apple-radius-pill: 980px;
  --apple-radius-circle: 50%;

  /* ---------- Spacing scale (dense low-end) ---------- */
  --sp-2: 2px;
  --sp-4: 4px;
  --sp-5: 5px;
  --sp-6: 6px;
  --sp-7: 7px;
  --sp-8: 8px;
  --sp-9: 9px;
  --sp-10: 10px;
  --sp-11: 11px;
  --sp-14: 14px;
  --sp-15: 15px;
  --sp-17: 17px;
  --sp-20: 20px;
  --sp-24: 24px;

  /* ---------- Focus ring (accessibility) ---------- */
  --sk-focus-color: var(--apple-blue);

  /* ---------- Nav glass ---------- */
  --apple-nav-bg: rgba(0, 0, 0, 0.8);
  --apple-nav-blur: saturate(180%) blur(20px);
  --apple-nav-height: 48px;

  /* ---------- Content max width ---------- */
  --apple-content-max: 980px;
}

/* =========================================================
   Base typography reset
   ========================================================= */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--apple-font-text);
  color: var(--apple-text-on-light);
  background: var(--apple-white);
  margin: 0;
}

/* =========================================================
   Semantic type styles — apply via class
   ========================================================= */

/* Display Hero — 56/1.07, 600, -0.28px */
.apple-t-display-hero {
  font-family: var(--apple-font-display);
  font-size: 56px;
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -0.28px;
}

/* Section Heading — 40/1.10, 600 */
.apple-t-section {
  font-family: var(--apple-font-display);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.10;
  letter-spacing: normal;
}

/* Tile Heading — 28/1.14, 400, +0.196px */
.apple-t-tile {
  font-family: var(--apple-font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: 0.196px;
}

/* Card Title — 21/1.19, 700, +0.231px */
.apple-t-card-title {
  font-family: var(--apple-font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.19;
  letter-spacing: 0.231px;
}

/* Sub-heading — 21/1.19, 400 */
.apple-t-subheading {
  font-family: var(--apple-font-display);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.19;
  letter-spacing: 0.231px;
}

/* Nav Heading — 34/1.47, 600, -0.374px (SF Pro Text) */
.apple-t-nav-heading {
  font-family: var(--apple-font-text);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.47;
  letter-spacing: -0.374px;
}

/* Sub-nav — 24/1.50, 300 */
.apple-t-subnav {
  font-family: var(--apple-font-text);
  font-size: 24px;
  font-weight: 300;
  line-height: 1.50;
}

/* Body — 17/1.47, 400, -0.374px */
.apple-t-body {
  font-family: var(--apple-font-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.47;
  letter-spacing: -0.374px;
}

/* Body Emphasis — 17/1.24, 600 */
.apple-t-body-em {
  font-family: var(--apple-font-text);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.374px;
}

/* Button Large — 18/1.00, 300 */
.apple-t-btn-lg {
  font-family: var(--apple-font-text);
  font-size: 18px;
  font-weight: 300;
  line-height: 1.00;
}

/* Button — 17/2.41, 400 */
.apple-t-btn {
  font-family: var(--apple-font-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 2.41;
}

/* Link — 14/1.43, 400, -0.224px */
.apple-t-link {
  font-family: var(--apple-font-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.43;
  letter-spacing: -0.224px;
}

/* Caption — 14/1.29, 400 */
.apple-t-caption {
  font-family: var(--apple-font-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.29;
  letter-spacing: -0.224px;
}

/* Caption Bold — 14/1.29, 600 */
.apple-t-caption-bold {
  font-family: var(--apple-font-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.29;
  letter-spacing: -0.224px;
}

/* Micro — 12/1.33, 400, -0.12px */
.apple-t-micro {
  font-family: var(--apple-font-text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.33;
  letter-spacing: -0.12px;
}

/* Micro Bold — 12/1.33, 600 */
.apple-t-micro-bold {
  font-family: var(--apple-font-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.33;
  letter-spacing: -0.12px;
}

/* Nano — 10/1.47, 400 */
.apple-t-nano {
  font-family: var(--apple-font-text);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.47;
  letter-spacing: -0.08px;
}

/* =========================================================
   Section color rhythm helpers
   ========================================================= */
.apple-section-dark  { background: var(--apple-black);      color: var(--apple-white); }
.apple-section-light { background: var(--apple-light-gray); color: var(--apple-near-black); }
.apple-section-white { background: var(--apple-white);      color: var(--apple-near-black); }

/* =========================================================
   Canonical components (Buttons, Nav glass, Cards)
   ========================================================= */

/* --- Primary Blue CTA --- */
.apple-btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--apple-font-text); font-size: 17px; font-weight: 400;
  line-height: 1;
  padding: 12px 22px;
  background: var(--apple-blue);
  color: var(--apple-white);
  border: 1px solid transparent;
  border-radius: var(--apple-radius-standard);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.apple-btn-primary:hover    { background: #0077ed; }
.apple-btn-primary:active   { background: #006edb; }
.apple-btn-primary:focus-visible {
  outline: 2px solid var(--sk-focus-color); outline-offset: 2px;
}

/* --- Primary Dark --- */
.apple-btn-dark {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--apple-font-text); font-size: 17px; font-weight: 400; line-height: 1;
  padding: 12px 22px;
  background: var(--apple-near-black);
  color: var(--apple-white);
  border: 1px solid transparent;
  border-radius: var(--apple-radius-standard);
  cursor: pointer;
  transition: background 160ms ease;
}
.apple-btn-dark:hover { background: #2a2a2d; }

/* --- Pill Link (the signature Apple inline CTA) --- */
.apple-pill-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--apple-font-text); font-size: 17px; font-weight: 400; line-height: 1;
  padding: 8px 16px;
  background: transparent;
  color: var(--apple-link-blue);
  border: 1px solid var(--apple-link-blue);
  border-radius: var(--apple-radius-pill);
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.apple-pill-link:hover { background: var(--apple-link-blue); color: var(--apple-white); }
.apple-pill-link--dark { color: var(--apple-bright-blue); border-color: var(--apple-bright-blue); }
.apple-pill-link--dark:hover { background: var(--apple-bright-blue); color: var(--apple-white); }

/* Inline "Learn more >" chevron link (not pill-wrapped) */
.apple-inline-link {
  font-family: var(--apple-font-text); font-size: 17px;
  color: var(--apple-link-blue); text-decoration: none;
  display: inline-flex; align-items: center; gap: 2px;
}
.apple-inline-link:hover { text-decoration: underline; }
.apple-inline-link--dark { color: var(--apple-bright-blue); }

/* --- Filter / Search button --- */
.apple-btn-filter {
  font-family: var(--apple-font-text); font-size: 14px;
  padding: 8px 14px;
  background: var(--apple-btn-default-light);
  color: rgba(0, 0, 0, 0.8);
  border: 3px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--apple-radius-comfortable);
  cursor: pointer;
}
.apple-btn-filter:focus-visible { outline: 2px solid var(--sk-focus-color); }

/* --- Media control (circular) --- */
.apple-btn-media {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--apple-radius-circle);
  background: var(--apple-overlay);
  color: rgba(0, 0, 0, 0.48);
  border: none; cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}
.apple-btn-media:active { transform: scale(0.9); }
.apple-btn-media:focus-visible {
  outline: 2px solid var(--sk-focus-color);
  background: var(--apple-white); color: var(--apple-black);
}

/* --- Navigation (glass) --- */
.apple-nav {
  position: sticky; top: 0; z-index: 9999;
  height: var(--apple-nav-height);
  background: var(--apple-nav-bg);
  -webkit-backdrop-filter: var(--apple-nav-blur);
          backdrop-filter: var(--apple-nav-blur);
  color: var(--apple-white);
}
.apple-nav-inner {
  max-width: 1024px; height: 100%;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
}
.apple-nav-link {
  font-family: var(--apple-font-text); font-size: 12px; font-weight: 400;
  color: var(--apple-white); opacity: 0.88;
  text-decoration: none;
  padding: 0 10px;
}
.apple-nav-link:hover { opacity: 1; }

/* Language switch — subtle KO · EN segment in the nav */
.apple-lang-switch {
  display: inline-flex; align-items: center;
  margin-left: 6px; padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  gap: 2px;
}
.apple-lang-link {
  font-family: var(--apple-font-text);
  font-size: 11px; font-weight: 500; letter-spacing: 0.4px;
  color: var(--apple-white); opacity: 0.55;
  text-decoration: none;
  padding: 2px 6px; border-radius: 4px;
  transition: opacity 120ms ease, background 120ms ease;
}
.apple-lang-link:hover { opacity: 0.85; }
.apple-lang-link.is-active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}
.apple-lang-sep {
  color: var(--apple-white); opacity: 0.3;
  font-size: 11px; padding: 0 2px; user-select: none;
}

/* --- Card --- */
.apple-card {
  background: var(--apple-light-gray);
  border-radius: var(--apple-radius-standard);
  padding: 24px;
}
.apple-card--elevated { box-shadow: var(--apple-shadow-card); background: var(--apple-white); }
.apple-card--dark     { background: var(--apple-surface-dark-1); color: var(--apple-white); }
