@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;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  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;
}
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset-block: 0;
  left: 50%;
  width: var(--frame-width);
  transform: translateX(-50%);
  border-inline: 1px solid var(--line);
  background-color: var(--sheet);
  background-image: repeating-linear-gradient(0deg, var(--ruling) 0 1px, transparent 1px 5px);
  pointer-events: none;
}
body[data-trams-preview] { padding-top: calc(var(--header-height) + 32px); }
a { color: inherit; }
button { color: inherit; font: inherit; }
img { display: block; max-width: 100%; }
[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);
}

.mag-header {
  position: fixed;
  z-index: 90;
  inset: 0 0 auto;
  height: var(--header-height);
  background: transparent;
}
.mag-header::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-block: 0;
  left: 50%;
  width: var(--frame-width);
  transform: translateX(-50%);
  border-inline: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--sheet);
  background: color-mix(in srgb, var(--sheet) 96%, transparent);
  backdrop-filter: blur(12px);
}
body[data-trams-preview] .mag-header { top: 32px; }
.mag-header__inner {
  position: relative;
  width: var(--frame-width);
  min-height: var(--header-height);
  margin-inline: auto;
  padding-inline: var(--shell-pad);
  display: flex;
  align-items: center;
  gap: 30px;
}
.mag-brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}
.mag-brand img {
  width: auto;
  height: 40px;
  transition: opacity .2s;
}
html[data-theme="dark"] .mag-brand img { filter: invert(1); }
.mag-brand:hover img { opacity: .72; }
.mag-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 24px;
}
.mag-nav a {
  position: relative;
  padding: 7px 0;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity .2s;
}
.mag-nav a:hover { opacity: .62; }
.mag-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  opacity: 0;
  transform: translate(-50%, 3px) scale(.4);
  transition: opacity .25s ease, transform .25s cubic-bezier(.2, .8, .2, 1);
}
.mag-nav a[aria-current="page"]::after {
  opacity: 1;
  transform: translate(-50%) scale(1);
}
.mag-theme {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-grid;
  flex: none;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.mag-theme svg { width: 20px; height: 20px; }
.mag-theme__rim { fill: none; stroke: currentColor; stroke-width: 1.4; }
.mag-theme__half { fill: currentColor; }
.mag-cta,
.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-cta:hover,
.mag-button:hover { background: var(--amber-light); }
.mag-mobile { display: none; margin-left: auto; }
.mag-mobile summary {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  background: transparent;
  cursor: pointer;
  list-style: none;
}
.mag-mobile summary::-webkit-details-marker { display: none; }
.mag-mobile summary > span {
  width: 23px;
  height: 2px;
  display: block;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .28s ease, opacity .18s, width .28s ease;
}
.mag-mobile summary > span:nth-child(2) { width: 15px; margin-left: 8px; }
.mag-mobile[open] summary > span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mag-mobile[open] summary > span:nth-child(2) { width: 0; opacity: 0; }
.mag-mobile[open] summary > span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mag-mobile__sheet {
  position: fixed;
  z-index: 1;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  left: 0;
  padding: clamp(36px, 7vh, 72px) var(--shell-pad) 28px;
  overflow-y: auto;
  border-top: 1px solid var(--line-soft);
  background: var(--sheet);
}
body[data-trams-preview] .mag-mobile__sheet { top: calc(var(--header-height) + 32px); }
.mag-mobile__panel { display: grid; }
.mag-mobile__row {
  min-height: 74px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.mag-mobile__index {
  color: var(--amber-strong);
  font-size: 11px;
  letter-spacing: .12em;
}
.mag-mobile__row a {
  display: block;
  font-size: clamp(30px, 8vw, 48px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.035em;
  text-decoration: none;
}
.mag-mobile__row a[aria-current="page"] { color: var(--amber-strong); }
.mag-mobile__foot {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  color: var(--muted);
  font-size: 13px;
}
.mag-mobile__foot a { text-underline-offset: 4px; }

.mag-kicker {
  color: var(--amber-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.mag-hero {
  min-height: 440px;
  padding-block: 104px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  align-items: end;
  gap: 72px;
  border-bottom: 1px solid var(--line);
}
.mag-hero h1 {
  max-width: 820px;
  margin: 18px 0 0;
  font-size: clamp(48px, 7vw, 108px);
  font-weight: 600;
  line-height: .96;
  letter-spacing: -.06em;
}
.mag-hero p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 1.7vw, 24px);
}

.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: clamp(26px, 3.2vw, 46px);
  font-weight: 600;
  line-height: 1.13;
  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: 80px 120px;
}
.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: clamp(42px, 7vw, 86px);
  font-weight: 600;
  line-height: 1.03;
  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 { border-top: 1px solid var(--line); }
.mag-footer__inner {
  padding-block: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.mag-footer h2 { margin: 0 0 12px; font-size: 16px; }
.mag-footer p { margin: 3px 0; color: var(--muted); font-size: 13px; }
.mag-footer a { text-underline-offset: 3px; }
.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;
}
:focus-visible { outline: 3px solid #1674ff; outline-offset: 4px; }

@media (min-width: 1537px) {
  :root { --frame-width: min(88vw, 1524px); --shell-pad: 68px; }
}

@media (max-width: 1180px) {
  :root { --frame-width: 98vw; --shell-pad: 40px; }
}

@media (max-width: 960px) {
  :root { --frame-width: 100%; --shell-pad: 25px; --header-height: 66px; }
  body:has(.mag-mobile[open]) { overflow: hidden; }
  .mag-header__inner { gap: 12px; }
  .mag-brand img { width: auto; height: 36px; }
  .mag-nav,
  .mag-header__inner > .mag-cta { display: none; }
  .mag-mobile { display: block; }
  .mag-hero { min-height: 0; grid-template-columns: 1fr; gap: 40px; padding-block: 72px 56px; }
  .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: 56px 80px; }
  .mag-figure { margin: 48px 0; }
  .mag-inquiry { grid-template-columns: 1fr; align-items: start; }
  .mag-button--amber { justify-self: start; }
  .mag-footer__inner { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 520px) {
  :root { --shell-pad: 20px; }
  body { word-break: normal; overflow-wrap: anywhere; }
  .mag-brand img { width: auto; height: 36px; }
  .mag-mobile__row { min-height: 68px; }
  .mag-filter__heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .mag-filter__button { min-height: 40px; padding-inline: 13px; }
  .mag-hero h1 { font-size: clamp(44px, 16vw, 68px); }
  .mag-article__header h1 { font-size: clamp(38px, 12vw, 58px); }
  .mag-body p { font-size: 18px; }
  .mag-inquiry { padding: 34px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
