@font-face {
  font-family: "Pretendard";
  src: url("/ai-si/fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #fffcf0;
  --paper-deep: #f3edd6;
  --sheet: #fffdf3;
  --tile: #efe9d2;
  --ink: #16140e;
  --muted: #57534a;
  --faint: #8b8577;
  --line: rgba(22, 20, 14, .16);
  --line-soft: rgba(22, 20, 14, .08);
  --ruling: rgba(22, 20, 14, .05);
  --amber: #f3b44a;
  --amber-strong: #c77e0a;
  --amber-light: #f9cb80;
  --white: #fffdf7;
  --frame-width: min(96vw, 1524px);
  --shell-pad: 52px;
  --header-height: 74px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #13120d;
  --paper-deep: #1f1c11;
  --sheet: #17160e;
  --tile: #221f13;
  --ink: #f1eee6;
  --muted: #a4a097;
  --faint: #928c7e;
  --line: rgba(241, 238, 230, .24);
  --line-soft: rgba(241, 238, 230, .12);
  --ruling: rgba(241, 238, 230, .075);
  --amber-strong: #dd922f;
  --white: #17160e;
}

.mag-site * { box-sizing: border-box; }
html[data-trams-editorial] { scroll-behavior: auto; }
body[data-trams-editorial] {
  min-height: 100vh;
  margin: 0;
  padding-top: var(--header-height);
  color: var(--ink);
  background: var(--paper);
  font-family: "Pretendard", system-ui, sans-serif;
  line-height: 1.65;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
html.is-ai-si[data-trams-editorial],
html.is-ai-si body[data-trams-editorial] { background: var(--paper); }
body[data-trams-preview] { padding-top: calc(var(--header-height) + 32px); }
.mag-site a { color: inherit; }
.mag-site button { color: inherit; font: inherit; }
.mag-site img { display: block; max-width: 100%; }
.mag-site [hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 120;
  left: 16px;
  top: -80px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
}
.skip-link:focus { top: 12px; }
.mag-shell {
  width: var(--frame-width);
  margin-inline: auto;
  padding-inline: var(--shell-pad);
}

/* Header/menu geometry, type, colors and animation come from the live site's
   sv-* stylesheets. Keep only collection-specific behavior here. */
.mag-site {
  --paper: var(--sv-page);
  --paper-deep: var(--sv-paper-2);
  --sheet: var(--sv-sheet);
  --tile: var(--sv-tile);
  --ink: var(--sv-ink);
  --muted: var(--sv-ink-2);
  --faint: var(--sv-ink-3);
  --line: var(--sv-line);
  --line-soft: var(--sv-line-2);
  --amber: var(--sv-amber);
  --amber-strong: var(--sv-amber-2);
  --amber-light: var(--sv-amber-lt);
  --frame-width: var(--sv-max);
  --shell-pad: calc(var(--sv-gutter) + var(--sv-inset));
  --header-height: var(--sv-nav-h);
  min-height: calc(100vh - var(--header-height));
}
body[data-trams-preview] .mag-header { top: 32px; }
body[data-trams-preview] .mag-mobile__sheet { top: 32px; height: calc(100dvh - 32px); }
.mag-button {
  min-height: 40px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  background: var(--amber);
  color: #16140e;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, transform .15s;
}
.mag-button:hover { background: var(--amber-light); }
.mag-site a.mag-button { color: #16140e; }

.mag-kicker {
  display: block;
  color: var(--amber-strong);
  font-family: var(--sv-code);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.mag-hero {
  position: relative;
  padding-block: 64px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px 48px;
}
.mag-hero::after {
  content: "";
  position: absolute;
  inset: auto var(--sv-gutter) 0;
  height: 1px;
  background: var(--line);
}
.mag-hero > .mag-kicker { grid-column: 1 / -1; }
.mag-site .mag-hero h1 {
  margin: 0;
  font-size: var(--trams-type-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.035em;
}
#development-cases-title { white-space: nowrap; }
.mag-site .mag-hero p {
  margin: 0;
  color: var(--muted);
  font-size: var(--trams-type-body);
  line-height: 1.7;
}

.mag-filter {
  padding-block: 34px 30px;
  border-bottom: 1px solid var(--line);
}
.mag-filter__heading {
  margin-bottom: 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.mag-filter__heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.02em;
}
.mag-filter__heading p { margin: 0; color: var(--muted); font-size: 13px; }
.mag-filter__scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.mag-filter__button {
  min-height: 42px;
  padding: 0 15px;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  background: var(--sheet);
  background: color-mix(in srgb, var(--sheet) 88%, transparent);
  cursor: pointer;
  font-size: 14px;
  font-weight: 550;
  transition: border-color .2s, background .2s;
}
.mag-filter__button:hover { border-color: var(--amber-strong); }
.mag-filter__button[aria-pressed="true"] {
  border-color: var(--amber);
  background: var(--amber);
  color: #16140e;
}
.mag-filter__count {
  min-width: 21px;
  height: 21px;
  padding-inline: 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 9%, transparent);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.mag-list.mag-shell {
  width: calc(var(--frame-width) - var(--shell-pad) - var(--shell-pad));
  padding-inline: 0;
}
.mag-list {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  border-left: 1px solid var(--line);
}
.mag-card {
  min-width: 0;
  grid-column: span 6;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--sheet);
  background: color-mix(in srgb, var(--sheet) 76%, transparent);
}
.mag-card__link { height: 100%; padding: 28px; display: grid; text-decoration: none; }
.mag-card__media { aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); background: var(--paper-deep); }
.mag-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.mag-card__link:hover .mag-card__media img { transform: scale(1.018); }
.mag-card__meta {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--amber-strong);
  font-size: 12px;
  letter-spacing: .06em;
}
.mag-card h2 {
  margin: 14px 0 8px;
  font-size: var(--trams-type-title);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.045em;
}
.mag-card p { margin: 0; color: var(--muted); font-size: 16px; }
.mag-empty,
.mag-filter-empty {
  min-height: 360px;
  padding: 64px clamp(24px, 6vw, 88px);
  grid-column: 1 / -1;
  align-content: center;
  gap: 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.mag-empty { display: grid; }
.mag-filter-empty:not([hidden]) { display: grid; }
.mag-empty h2,
.mag-filter-empty h2 {
  margin: 0;
  font-size: clamp(32px, 4.5vw, 62px);
  font-weight: 600;
  letter-spacing: -.045em;
}
.mag-empty p,
.mag-filter-empty p { max-width: 620px; margin: 0; color: var(--muted); }

.mag-article {
  width: min(var(--frame-width), 1140px);
  padding-block: 64px 96px;
}
.mag-article__header { padding-bottom: 52px; border-bottom: 1px solid var(--line); }
.mag-article__header h1 {
  max-width: 970px;
  margin: 18px 0 24px;
  font-size: var(--trams-type-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.055em;
}
.mag-article__description { max-width: 760px; margin: 0; color: var(--muted); font-size: clamp(18px, 2vw, 24px); }
.mag-article__meta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  color: var(--muted);
  font-size: 13px;
}
.mag-body { max-width: 820px; margin: 0 auto; padding-top: 72px; }
.mag-body p { margin: 0 0 32px; font-size: clamp(18px, 1.7vw, 22px); line-height: 1.85; }
.mag-body h2 { margin: 88px 0 26px; font-size: clamp(32px, 4vw, 52px); line-height: 1.16; letter-spacing: -.04em; }
.mag-body h3 { margin: 64px 0 22px; font-size: clamp(25px, 3vw, 36px); line-height: 1.2; letter-spacing: -.035em; }
.mag-figure { margin: 64px -80px; }
.mag-figure img { width: 100%; height: auto; border: 1px solid var(--line); background: var(--paper-deep); }
.mag-figure figcaption { margin-top: 12px; color: var(--muted); font-size: 13px; }
.mag-article[data-writing-style="saved"] .mag-article__header h1 { font-family: var(--writing-font); font-size: var(--writing-title-size); color: var(--writing-title-color); line-height: 1.4; }
.mag-article[data-writing-style="saved"] .mag-article__description { display: none; }
.mag-article[data-writing-style="saved"] .mag-article__header { padding-bottom: 24px; }
.mag-article[data-writing-style="saved"] .mag-body { padding-top: 28px; }
.mag-article[data-writing-style="saved"] .mag-body p { font-family: var(--writing-font); font-size: var(--writing-size); color: var(--writing-color); white-space: pre-line; }
.mag-article[data-writing-style="saved"] .mag-body h2 { margin-top: 44px; color: var(--writing-heading-color); font-family: var(--writing-font); font-size: var(--writing-heading-size); font-weight: 700; }
.mag-summary { margin: 0 0 36px; padding: 22px 24px; border-left: 3px solid var(--amber-strong); background: var(--paper-deep); }
.mag-article[data-writing-style="saved"] .mag-summary h2 { margin: 0 0 14px; }
.mag-article[data-writing-style="saved"] .mag-summary p { margin-bottom: 0; white-space: pre-line; }
.mag-article[data-writing-style="saved"] .mag-figure { margin: 32px 0; }
.mag-article[data-writing-style="saved"] .mag-figure img { max-height: 680px; object-fit: contain; }
.mag-article[data-writing-style="saved"] .mag-figure figcaption { color: var(--writing-caption-color); font-size: var(--writing-caption-size); }
html[data-theme="dark"] .mag-article[data-writing-style="saved"] :is(.mag-article__header h1, .mag-body p, .mag-body h2, .mag-figure figcaption) { color: var(--ink); }
.mag-sources { max-width: 820px; margin: 80px auto 0; padding-top: 32px; border-top: 1px solid var(--line); }
.mag-sources h2 { font-size: 18px; }
.mag-sources ol { padding-left: 22px; }
.mag-sources a { color: var(--muted); overflow-wrap: anywhere; text-underline-offset: 4px; }

.mag-inquiry {
  position: relative;
  max-width: 920px;
  margin: 96px auto 0;
  padding: clamp(34px, 5vw, 62px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px;
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: var(--sheet);
  background-image: repeating-linear-gradient(0deg, var(--ruling) 0 1px, transparent 1px 5px);
  box-shadow: inset 4px 0 0 var(--amber);
}
.mag-inquiry__mark {
  position: absolute;
  top: 0;
  right: 0;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--amber);
  color: #16140e;
  font-size: 20px;
}
.mag-inquiry h2 {
  max-width: 680px;
  margin: 12px 0 10px;
  font-size: clamp(28px, 4vw, 50px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.045em;
}
.mag-inquiry p { max-width: 600px; margin: 0; color: var(--muted); }
.mag-button--amber { min-height: 48px; white-space: nowrap; }

.mag-footer { margin-top: 64px; }
.mag-preview-bar {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  height: 32px;
  padding: 6px 24px;
  background: #241f17;
  color: white;
  text-align: center;
  font-size: 12px;
  letter-spacing: .08em;
}
.mag-site :focus-visible { outline: 3px solid #1674ff; outline-offset: 4px; }

@media (max-width: 960px) {
  :root { --header-height: 66px; }
  body.mag-menu-open { overflow: hidden; }
  .mag-hero { grid-template-columns: 1fr; gap: 20px; padding-block: 40px 32px; }
  .mag-filter { padding-block: 26px 22px; }
  .mag-filter__scroll { margin-right: calc(0px - var(--shell-pad)); padding-right: var(--shell-pad); }
  .mag-card { grid-column: 1 / -1; }
  .mag-card__link { padding: 24px 0 38px; }
  .mag-list { border-left: 0; }
  .mag-card,
  .mag-empty,
  .mag-filter-empty { border-right: 0; }
  .mag-article { width: var(--frame-width); padding-block: 40px 80px; }
  .mag-figure { margin: 48px 0; }
  .mag-inquiry { grid-template-columns: 1fr; align-items: start; }
  .mag-button--amber { justify-self: start; }
}

@media (max-width: 520px) {
  body[data-trams-editorial] { word-break: normal; overflow-wrap: anywhere; }
  .mag-filter__heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .mag-filter__button { min-height: 40px; padding-inline: 13px; }
  .mag-body p { font-size: 18px; }
  .mag-inquiry { padding: 34px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-trams-editorial] { scroll-behavior: auto; }
  .mag-site *, .mag-site *::before, .mag-site *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
