/* Shared by the full site and by the samples in the style picker. */
:root {
  --font-sans: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
  --font-serif: "Nanum Myeongjo", "Noto Serif KR", Batang, AppleMyungjo, Georgia, serif;
}

:root,
[data-theme="forest"] {
  --page: #fbfcf7;
  --surface: #ffffff;
  --surface-alt: #eef3e8;
  --ink: #172b21;
  --muted: #4c6254;
  --line: #b6c7b6;
  --accent: #245638;
  --on-accent: #ffffff;
  --accent-soft: #e5efdc;
  --highlight: #a9441e;
  --hero-bg: #eaf0dd;
  --hero-ink: #153a2b;
  --hero-muted: #38533d;
  --hero-accent: #98401d;
  --footer-bg: #163b2e;
  --footer-ink: #f5faeb;
  --footer-muted: #d1e3d4;
  --focus: #935110;
  --danger: #97372b;
  --success: #275c36;
  --font-body: var(--font-sans);
  --font-heading: var(--font-sans);
  --radius: 12px;
  --shadow: 0 8px 28px #1a382911;
  --control-line: var(--muted);
  color-scheme: light;
}

[data-theme="midnight"] {
  --page: #101626;
  --surface: #192235;
  --surface-alt: #202c42;
  --ink: #f0f4ff;
  --muted: #b3c2dc;
  --line: #566680;
  --accent: #a9caff;
  --on-accent: #12233e;
  --accent-soft: #253956;
  --highlight: #f3b672;
  --hero-bg: #10192d;
  --hero-ink: #f6f7ff;
  --hero-muted: #bdcee8;
  --hero-accent: #8adcf3;
  --footer-bg: #0e1423;
  --footer-ink: #f1f5ff;
  --footer-muted: #bbcae3;
  --focus: #ffce83;
  --danger: #ffa8a5;
  --success: #9de6b2;
  --font-body: var(--font-sans);
  --font-heading: var(--font-sans);
  --radius: 14px;
  --shadow: 0 12px 30px #00000048;
  --control-line: var(--muted);
  color-scheme: dark;
}

[data-theme="ocean"] {
  --page: #f4fafc;
  --surface: #ffffff;
  --surface-alt: #e3f0f5;
  --ink: #10344b;
  --muted: #395d70;
  --line: #9fbac6;
  --accent: #075479;
  --on-accent: #ffffff;
  --accent-soft: #d9edf3;
  --highlight: #a34325;
  --hero-bg: #124565;
  --hero-ink: #f5fcff;
  --hero-muted: #c6e8f2;
  --hero-accent: #a8f3f5;
  --footer-bg: #102f43;
  --footer-ink: #f3fbff;
  --footer-muted: #c6e1e8;
  --focus: #973f16;
  --danger: #a02b38;
  --success: #226641;
  --font-body: var(--font-sans);
  --font-heading: var(--font-sans);
  --radius: 10px;
  --shadow: 0 9px 24px #12456518;
  --control-line: var(--muted);
  color-scheme: light;
}

[data-theme="lavender"] {
  --page: #faf8ff;
  --surface: #ffffff;
  --surface-alt: #efe9f8;
  --ink: #342542;
  --muted: #624d74;
  --line: #beaccf;
  --accent: #634784;
  --on-accent: #ffffff;
  --accent-soft: #eae1f3;
  --highlight: #7e3a70;
  --hero-bg: #ece3fa;
  --hero-ink: #3d2959;
  --hero-muted: #594670;
  --hero-accent: #744386;
  --footer-bg: #352842;
  --footer-ink: #fbf5ff;
  --footer-muted: #e6d8ee;
  --focus: #733780;
  --danger: #963b48;
  --success: #326b4a;
  --font-body: var(--font-sans);
  --font-heading: var(--font-serif);
  --radius: 20px;
  --shadow: 0 12px 32px #43305e18;
  --control-line: var(--muted);
  color-scheme: light;
}

[data-theme="paper"] {
  --page: #f7f3e9;
  --surface: #fffdf6;
  --surface-alt: #ede6d5;
  --ink: #332c23;
  --muted: #635747;
  --line: #bcad93;
  --accent: #654222;
  --on-accent: #ffffff;
  --accent-soft: #ece1c9;
  --highlight: #934324;
  --hero-bg: #f1e8d5;
  --hero-ink: #392e23;
  --hero-muted: #5c5041;
  --hero-accent: #8c361d;
  --footer-bg: #352f27;
  --footer-ink: #fff8e7;
  --footer-muted: #e4d8bd;
  --focus: #87441f;
  --danger: #8c3027;
  --success: #3e612d;
  --font-body: var(--font-serif);
  --font-heading: var(--font-serif);
  --radius: 2px;
  --shadow: 0 4px 12px #4d402815;
  --control-line: var(--muted);
  color-scheme: light;
}

[data-theme="rose"] {
  --page: #fff8f7;
  --surface: #ffffff;
  --surface-alt: #f9e9e6;
  --ink: #3f292f;
  --muted: #704e58;
  --line: #d3b3b9;
  --accent: #823c52;
  --on-accent: #ffffff;
  --accent-soft: #f6dfe4;
  --highlight: #923f22;
  --hero-bg: #f5e2e5;
  --hero-ink: #572a3e;
  --hero-muted: #664456;
  --hero-accent: #943953;
  --footer-bg: #4b2837;
  --footer-ink: #fff3f4;
  --footer-muted: #ebd3d9;
  --focus: #963d56;
  --danger: #962b3e;
  --success: #376747;
  --font-body: var(--font-sans);
  --font-heading: var(--font-serif);
  --radius: 17px;
  --shadow: 0 9px 25px #752d4417;
  --control-line: var(--muted);
  color-scheme: light;
}

[data-theme="mint"] {
  --page: #f2fbf7;
  --surface: #ffffff;
  --surface-alt: #e1f2ea;
  --ink: #163a32;
  --muted: #3e6054;
  --line: #a5c6b5;
  --accent: #086248;
  --on-accent: #ffffff;
  --accent-soft: #d3eee2;
  --highlight: #824817;
  --hero-bg: #dcf4e8;
  --hero-ink: #154435;
  --hero-muted: #375c4d;
  --hero-accent: #06654e;
  --footer-bg: #123c33;
  --footer-ink: #eefff7;
  --footer-muted: #c6e6d6;
  --focus: #854510;
  --danger: #9c3543;
  --success: #126641;
  --font-body: var(--font-sans);
  --font-heading: var(--font-sans);
  --radius: 22px;
  --shadow: 0 8px 26px #19463216;
  --control-line: var(--muted);
  color-scheme: light;
}

[data-theme="terracotta"] {
  --page: #fff7ed;
  --surface: #fffdf8;
  --surface-alt: #f4e6d5;
  --ink: #452d26;
  --muted: #6c5044;
  --line: #cfad96;
  --accent: #8d3d28;
  --on-accent: #ffffff;
  --accent-soft: #f6dfcd;
  --highlight: #764829;
  --hero-bg: #843c27;
  --hero-ink: #fffaf0;
  --hero-muted: #f5dfce;
  --hero-accent: #ffda96;
  --footer-bg: #482a20;
  --footer-ink: #fff8e9;
  --footer-muted: #eed7c1;
  --focus: #924426;
  --danger: #923038;
  --success: #4d622c;
  --font-body: var(--font-sans);
  --font-heading: var(--font-serif);
  --radius: 4px;
  --shadow: 0 7px 16px #723b281d;
  --control-line: var(--muted);
  color-scheme: light;
}

[data-theme="mono"] {
  --page: #fafafa;
  --surface: #ffffff;
  --surface-alt: #ededed;
  --ink: #171717;
  --muted: #515151;
  --line: #b4b4b4;
  --accent: #242424;
  --on-accent: #ffffff;
  --accent-soft: #e5e5e5;
  --highlight: #454545;
  --hero-bg: #ebebeb;
  --hero-ink: #121212;
  --hero-muted: #424242;
  --hero-accent: #373737;
  --footer-bg: #1c1c1c;
  --footer-ink: #ffffff;
  --footer-muted: #d6d6d6;
  --focus: #323232;
  --danger: #802b36;
  --success: #235434;
  --font-body: var(--font-sans);
  --font-heading: var(--font-sans);
  --radius: 0px;
  --shadow: 0 5px 16px #11111112;
  --control-line: var(--muted);
  color-scheme: light;
}

[data-theme="contrast"] {
  --page: #000000;
  --surface: #080808;
  --surface-alt: #171717;
  --ink: #ffffff;
  --muted: #e5e5e5;
  --line: #a1a1a1;
  --accent: #ffe651;
  --on-accent: #101010;
  --accent-soft: #282600;
  --highlight: #72edff;
  --hero-bg: #000000;
  --hero-ink: #ffffff;
  --hero-muted: #eeeeee;
  --hero-accent: #ffe651;
  --footer-bg: #000000;
  --footer-ink: #ffffff;
  --footer-muted: #eeeeee;
  --focus: #60e9ff;
  --danger: #ffaca8;
  --success: #98ffb6;
  --font-body: var(--font-sans);
  --font-heading: var(--font-sans);
  --radius: 3px;
  --shadow: none;
  --control-line: var(--muted);
  color-scheme: dark;
}

@supports (color: color-mix(in srgb, black, white)) {
  :root, [data-theme] {
    --control-line: color-mix(in srgb, var(--muted) 80%, var(--surface));
  }
}

@media screen {
  .hero .hero-copy { min-width: 0; }

  .hero .hero-visual {
    isolation: isolate;
    align-self: center;
    height: clamp(300px, 29vw, 410px);
    min-height: 0;
  }

  .hero .hero-visual img {
    inset: 0;
    display: block;
  }

  .hero .photo-lines { pointer-events: none; }

  .hero .suggest a:focus-visible {
    outline-color: var(--hero-accent);
  }

  /* Forest pairs the institute green with a botanical arch. */
  html:not([data-theme]) .hero-visual img,
  html[data-theme="forest"] .hero-visual img {
    border-radius: 4px clamp(35px, 6vw, 86px) 4px 4px;
  }

  /* Cool grid paper frames the photograph on the night desk. */
  html[data-theme="midnight"] .hero {
    background-image:
      linear-gradient(90deg, var(--hero-bg) 22%, transparent 88%),
      linear-gradient(#92b9f11a 1px, transparent 1px),
      linear-gradient(90deg, #92b9f11a 1px, transparent 1px);
    background-size: auto, 32px 32px, 32px 32px;
  }

  html[data-theme="midnight"] .hero-visual img {
    border: 1px solid #7a9ebc;
    border-radius: 18px;
    box-shadow: 7px 7px 0 #283854;
  }

  html[data-theme="midnight"] .photo-lines {
    inset: 14px auto auto 14px;
    width: 22px;
    height: 22px;
    border: solid #e0f5ff;
    border-width: 2px 0 0 2px;
    background: transparent;
  }

  /* Ocean opens on a waterfront blue field with a wide, curved photograph. */
  html[data-theme="ocean"] .hero {
    background-image: linear-gradient(115deg, transparent 42%, #0d596b 100%);
  }

  html[data-theme="ocean"] .hero-visual img {
    border-radius: 4px 4px clamp(54px, 9vw, 120px) 4px;
  }

  html[data-theme="ocean"] .photo-lines {
    inset: auto 12% 0 auto;
    width: 18%;
    height: 5px;
  }

  /* Lavender uses a high arch and a fine outer contour. */
  html[data-theme="lavender"] .hero-visual img {
    border-radius: 50% 50% 12px 12px / 40% 40% 12px 12px;
    outline: 1px solid #967faf;
    outline-offset: 5px;
  }

  html[data-theme="lavender"] .photo-lines,
  html[data-theme="rose"] .photo-lines,
  html[data-theme="mint"] .photo-lines { display: none; }

  html[data-theme="lavender"] .hero h1,
  html[data-theme="rose"] .hero h1,
  html[data-theme="paper"] .hero h1,
  html[data-theme="terracotta"] .hero h1 {
    letter-spacing: -.067em;
    line-height: 1.16;
  }

  /* Paper uses a bookplate, a mounted photograph and fine editorial rules. */
  html[data-theme="paper"] .hero,
  html[data-theme="paper"] .section-head {
    border-bottom: 4px double var(--line);
  }

  html[data-theme="paper"] .section-head { padding-bottom: 12px; }

  html[data-theme="paper"] .hero-visual img {
    border: 7px solid var(--surface);
    border-radius: 1px;
    outline: 1px solid var(--line);
    box-shadow: 3px 4px 0 #ad9c7c48;
    filter: sepia(.28) saturate(.77);
  }

  html[data-theme="paper"] .photo-lines {
    inset: auto 25% -6px;
    width: 50%;
    height: 1px;
    background: var(--hero-accent);
  }

  /* Rose has staggered corners and soft rules, like a portrait mount. */
  html[data-theme="rose"] .hero-visual img {
    border-radius: clamp(35px, 6vw, 85px) 5px clamp(35px, 6vw, 85px) 5px;
  }

  html[data-theme="rose"] .hero-visual::before {
    content: "";
    position: absolute;
    inset: 5px -5px -5px 5px;
    border: 1px solid #a66e83;
    border-radius: clamp(35px, 6vw, 85px) 5px clamp(35px, 6vw, 85px) 5px;
    z-index: -1;
  }

  /* Mint takes its geometry from the pill-shaped search field. */
  html[data-theme="mint"] .hero-visual img {
    border-radius: 999px 45% 45% 999px;
  }

  html[data-theme="mint"] .hero .searchbox,
  html[data-theme="mint"] .hero .searchbox button,
  html[data-theme="mint"] .cat { border-radius: 999px; }

  html[data-theme="mint"] .hero .suggest a {
    padding-inline: .65em;
    border: 1px solid var(--line);
    border-radius: 999px;
  }

  /* The rust studio mounts a square-cut picture over an ochre backing. */
  html[data-theme="terracotta"] .hero-visual img {
    border-radius: 2px;
    box-shadow: 8px 8px 0 #cf965d;
  }

  html[data-theme="terracotta"] .photo-lines {
    inset: 0 auto auto 0;
    width: clamp(28px, 6vw, 75px);
    height: 6px;
  }

  /* Mono uses ink rules and a black-and-white lead photograph. */
  html[data-theme="mono"] .hero,
  html[data-theme="mono"] .section-head {
    border-bottom: 2px solid var(--ink);
  }

  html[data-theme="mono"] .section-head { padding-bottom: 10px; }

  html[data-theme="mono"] .hero-visual img {
    border-radius: 0;
    filter: grayscale(1);
  }

  html[data-theme="mono"] .photo-lines {
    inset: auto 0 0 auto;
    width: 25%;
    height: 7px;
    background: var(--ink);
  }

  /* The high-contrast layout increases target boundaries and link recognition. */
  html[data-theme="contrast"] .hero-visual img {
    border-radius: 0;
    border: 3px solid var(--line);
  }

  html[data-theme="contrast"] .photo-lines { display: none; }

  html[data-theme="contrast"] :is(.searchbox, .course-card, .panel, .secondary, .pager a, .login) {
    border-width: 2px;
  }

  html[data-theme="contrast"] :is(.nav a, .suggest a, .text-link, .directory a, .foot a) {
    text-decoration: underline;
    text-underline-offset: .18em;
  }

  html[data-theme="contrast"] :focus-visible { outline-width: 4px; }
}

@media screen and (min-width: 760px) {
  html:is([data-theme="ocean"], [data-theme="rose"], [data-theme="terracotta"]) .hero-grid {
    grid-template-areas: "picture intro";
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  html:is([data-theme="ocean"], [data-theme="rose"], [data-theme="terracotta"]) .hero-visual {
    grid-area: picture;
  }

  html:is([data-theme="ocean"], [data-theme="rose"], [data-theme="terracotta"]) .hero-copy {
    grid-area: intro;
  }

  html[data-theme="paper"] .hero-visual {
    margin-inline: 5%;
    transform: rotate(-1.3deg);
  }

  html[data-theme="lavender"] .hero-visual { margin-inline: 7%; }

  html[data-theme="mono"] .hero-grid {
    grid-template-columns: .95fr 1.05fr;
    gap: 6%;
  }

  html[data-theme="contrast"] .hero-copy {
    border-left: 5px solid var(--accent);
    padding-left: clamp(15px, 2vw, 30px);
  }
}

@media screen and (max-width: 650px) {
  .hero .hero-visual { height: clamp(145px, 44vw, 220px); }
  html[data-theme="lavender"] .hero-visual { margin: 4px; }
  html[data-theme="midnight"] .hero-visual,
  html[data-theme="terracotta"] .hero-visual { margin-right: 7px; }
  html[data-theme="rose"] .hero-visual { margin-right: 5px; }
  html[data-theme="mint"] .suggest { gap: 6px; }
  html[data-theme="contrast"] .hero h1 { font-size: clamp(40px, 11vw, 48px); }
}

@media print {
  :root, :root[data-theme] {
    color-scheme: light;
    --page: #fff;
    --surface: #fff;
    --surface-alt: #f3f3f3;
    --ink: #111;
    --muted: #343434;
    --line: #888;
    --accent: #111;
    --on-accent: #fff;
    --accent-soft: #eee;
    --highlight: #111;
    --hero-bg: #fff;
    --hero-ink: #111;
    --hero-muted: #343434;
    --hero-accent: #111;
    --footer-bg: #fff;
    --footer-ink: #111;
    --footer-muted: #343434;
    --danger: #111;
    --success: #111;
    --shadow: none;
  }
}
