:root {
  color-scheme: light;
  --window: #ededf0; --card: #ffffff; --page: #fff; --label: rgba(0,0,0,.88); --sub: rgba(0,0,0,.52);
  --accent: #007aff; --accent-fill: #0071e3; --green: #34c759; --red: #ff3b30; --glass: rgba(250,250,252,.62); --glass-ctl: rgba(255,255,255,.66); --glass-lens-ctl: rgba(255,255,255,.46); --glass-ctl-solid: #fbfbfc;
  --sheen: rgba(255,255,255,.6); --edge: rgba(0,0,0,.08); --rim: rgba(255,255,255,.95);
  --sep: rgba(0,0,0,.08); --hover: rgba(0,0,0,.045); --sep-strong: rgba(0,0,0,.2); --head: rgba(0,0,0,.07);
  --elev-panel: 0 1px 1px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.1);
  --elev-ctl: 0 1px 2px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.06);
  --thumb: rgba(118,118,128,.16);
  --motion-quick: 120ms; --motion-base: 240ms; --motion-page: 360ms; --motion-pop: calc(var(--motion-base) * 2 / 3);
  --ease-travel: cubic-bezier(.2,.8,.2,1); --ease-fade: ease-out;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Noto Sans", "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", "Noto Sans TC", "Noto Sans Tamil", "Noto Sans Thai", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media all {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --window: #0c0c0e; --card: #1c1c1e; --page: #1c1c1e; --label: #fff; --sub: rgba(255,255,255,.55);
    --accent: #0a84ff; --accent-fill: #0071e3; --green: #30d158; --red: #ff453a; --glass: rgba(44,44,46,.56); --glass-ctl: rgba(58,58,60,.52); --glass-lens-ctl: rgba(40,40,42,.46); --glass-ctl-solid: #2a2a2c;
    --sheen: rgba(255,255,255,.07); --edge: rgba(255,255,255,.13); --rim: rgba(255,255,255,.16);
    --thumb: rgba(255,255,255,.14);
    --sep: rgba(255,255,255,.1); --sep-strong: rgba(255,255,255,.22); --head: rgba(255,255,255,.1); --hover: rgba(255,255,255,.06);
    --elev-panel: 0 12px 32px rgba(0,0,0,.4); --elev-ctl: 0 4px 12px rgba(0,0,0,.3);
    }
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
/* Phones turn text up by themselves when the screen is turned to landscape; keep the sizes we set. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { background: var(--window); color: var(--label); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); font-size: .93em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }


.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr) 340px; gap: 12px; height: 100vh; padding: 12px; }
.pane { border-radius: 18px; min-height: 0; overflow: auto; }
.glass-panel {
  background: var(--card);
  border: .5px solid var(--edge); box-shadow: var(--elev-panel);
}
.glass {
  background: linear-gradient(180deg, var(--sheen), rgba(255,255,255,0) 60%), var(--glass-ctl);
  -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8);
  border: .5px solid var(--edge); box-shadow: inset 0 1px 0 var(--rim), var(--elev-ctl);
}
.ctl { display: inline-flex; align-items: center; height: 38px; padding: 0 18px; border-radius: 999px; color: var(--label); }
h1 { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 13px; font-weight: 600; color: var(--sub); margin: 0 0 8px; }
h2.gap { margin-top: 28px; }
.plain { list-style: none; padding: 0; }
.plain li { padding: 3px 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.side { display: flex; flex-direction: column; padding: 16px 12px 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--label); font-size: 18px; font-weight: 650; padding: 4px 8px 20px; }
.brand:hover { text-decoration: none; }
.logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; font-size: 19px; }
.side h2 { padding: 0 12px; }
.nav a { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 10px; color: var(--label); font-size: 16px; }
.nav a:hover { background: var(--hover); text-decoration: none; }
.nav a.on { background: var(--hover); font-weight: 600; }
.nav a svg { color: var(--accent); }
.side-foot { margin-top: auto; }

.files { display: flex; flex-direction: column; overflow: hidden; }
.bar { display: flex; align-items: baseline; justify-content: space-between; padding: 20px 28px 12px; }
.up { color: var(--sub); }
.fhead, .file { display: grid; grid-template-columns: 20px minmax(0, 1fr) 110px 80px; gap: 14px; align-items: center; padding: 0 28px; }
.fhead { height: 32px; font-size: 12px; font-weight: 600; color: var(--sub); border-bottom: .5px solid var(--sep); }
.fhead span:nth-child(3), .fhead span:nth-child(4), .fd, .fs { text-align: right; }
.flist { overflow: auto; flex: 1; }
.file { height: 44px; color: var(--label); font-size: 15px; box-shadow: 0 .5px 0 var(--sep); }
.file:hover { background: var(--hover); text-decoration: none; }
.file svg { color: var(--accent); }
.file:not([href$="/"]) svg { color: var(--sub); }
.fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd, .fs { color: var(--sub); font-size: 14px; font-variant-numeric: tabular-nums; }

.detail { padding: 20px 24px; }
dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: .5px solid var(--sep); }
dl > div:first-child { border-top: 0; }
dt { color: var(--sub); }
dd { text-align: right; font-weight: 550; }

@media (max-width: 1000px) {
  .shell { display: flex; flex-direction: column; height: auto; }
  .pane { overflow: visible; }
  .flist { overflow: visible; }
  .fhead, .file { grid-template-columns: 20px minmax(0, 1fr) 90px; }
  .fhead span:nth-child(4), .fs { display: none; }
}

/* Home: content kept inside 1200px so the sides stay free on a desktop, as on KAIST. */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px 48px; }
.top { position: relative; z-index: 10; display: flex; align-items: center; justify-content: space-between; height: 72px; }
.top .brand { padding: 0; white-space: nowrap; font-size: 28px; letter-spacing: -.025em; gap: 8px; align-items: baseline; }
.brand .b { font-weight: 300; color: var(--sub); }
.brand .a { font-weight: 750; }
.tools { display: flex; align-items: center; gap: 10px; }
.seg { position: relative; isolation: isolate; display: inline-flex; align-items: center; height: 38px; padding: 0 2px; border-radius: 999px; }
.seg button { position: relative; z-index: 1; width: 36px; height: 33px; display: grid; place-items: center; border: 0; background: transparent; color: var(--sub); border-radius: 999px; cursor: pointer; transition: color var(--motion-quick) var(--ease-fade); touch-action: none; }
.seg button[aria-checked="true"] { color: var(--label); }
.seg button:focus-visible { outline: 2px solid var(--accent); }
.seg svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }

/* The lens (SaltyMail theme.css): the pill under the labels at rest and the glass lens over them while
   held or moving. theme.js drives both layers every frame (springs): their size, squash, opacity, the
   glass's shadow and the filter's displacement. Nothing here transitions them. */
.lens-thumb, .lens-glass { position: absolute; top: 0; left: 0; border-radius: 999px; pointer-events: none; transform-origin: 0 0; }
.lens-thumb { z-index: 0; background: var(--thumb); }
.lens-glass { z-index: 2; display: none;
  background: linear-gradient(180deg, var(--sheen), rgba(255,255,255,0) 60%), var(--glass-ctl);
  -webkit-backdrop-filter: blur(2px) saturate(1.8); backdrop-filter: blur(2px) saturate(1.8);
  box-shadow: inset 0 1px 0 var(--rim), 0 0 0 .5px var(--edge), var(--elev-ctl); }
@media (prefers-reduced-transparency: no-preference) {
  :root[data-refraction="on"] .lens-glass {
    background: linear-gradient(180deg, var(--sheen), rgba(255,255,255,0) 60%), var(--glass-lens-ctl);
    backdrop-filter: var(--lens-thumb-filter);
  }
}
@media (prefers-reduced-transparency: reduce), (prefers-reduced-motion: reduce) { .lens-glass { display: none !important; } .lens-thumb { opacity: 1 !important; } }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.pane { overflow: visible; }
.col { display: flex; flex-direction: column; gap: 16px; }
.box { padding: 22px 24px 24px; }
.code { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--hover); font-size: 14px; line-height: 1.7; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -.015em; }

.mirrors { padding: 28px 32px 16px; }
.stat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0 28px; }
.stat span { display: block; color: var(--sub); font-size: 15px; }
.stat b { display: block; font-size: 30px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.tr { display: grid; grid-template-columns: 1.2fr 1.6fr 1fr 72px; gap: 16px; align-items: center; min-height: 62px; font-size: 17px; position: relative; }
.tr::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: .5px; background: var(--sep); }
.tr:last-child::after { display: none; }
.th { min-height: 44px; font-size: 15px; font-weight: 600; color: var(--sub); }
.tr b { font-weight: 600; }
.tr .sub { color: var(--sub); font-size: 15px; }
.tr a { font-weight: 600; text-align: right; }
.st { display: inline-flex; align-items: center; gap: 8px; }
.st-icon:empty { display: none; }
.st svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.st.ok svg { color: var(--green); }
.st.sync svg { color: var(--accent); animation: st-spin .9s linear infinite; }
.st.fail svg { color: var(--red); }
@keyframes st-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .st.sync svg { animation: none; } }
@media (max-width: 900px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .tr { grid-template-columns: 1fr auto; }
  .tr .sub, .th span:nth-child(2) { display: none; }
  .tr .st, .th span:nth-child(3) { display: none; }
  .stat b { font-size: 24px; }
}

.left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.doc { padding: 28px 32px 32px; }
.dh { font-size: 22px; font-weight: 700; color: var(--label); margin: 0 0 14px; letter-spacing: -.01em; }
.dh.gap { margin-top: 32px; }
.doc p { margin: 0 0 10px; font-size: 15px; line-height: 1.6; }
.note { margin: 0 0 14px; color: var(--sub); }
.btn { text-decoration: none; font-weight: 600; color: var(--accent); }

/* Motion: SaltyMail's durations and easing. */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pane { animation: rise var(--motion-page) var(--ease-travel) both; }
.doc { animation-delay: 0ms; }
.mirrors { animation-delay: 70ms; }
.col > .box:nth-child(1) { animation-delay: 40ms; }
.col > .box:nth-child(2) { animation-delay: 90ms; }
.col > .box:nth-child(3) { animation-delay: 140ms; }
.top { animation: rise var(--motion-page) var(--ease-travel) both; }
a { transition: color var(--motion-quick) var(--ease-fade), opacity var(--motion-quick) var(--ease-fade); }
a:hover { opacity: .75; text-decoration: none; }
.ctl, .glass { transition: scale var(--motion-quick) var(--ease-travel), background-color var(--motion-quick) var(--ease-fade); }
.ctl:active, .seg button:active { scale: .97; }
.tr { margin: 0 -12px; padding: 0 12px; border-radius: 10px; transition: background-color var(--motion-quick) var(--ease-fade); }
.tr:not(.th):hover { background: var(--hover); }
@media (prefers-reduced-motion: reduce) {
  .pane, .top { animation: none; }
  .ctl, .glass, .seg button, a, .tr { transition: none; }
  .ctl:active, .seg button:active { scale: none; }
}

/* The theme change is a cross-fade of the page. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--motion-base); animation-timing-function: var(--ease-fade); }
/* The lens bends what is under it; a blur on the control itself would hide the control's fill from it. */
.seg { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-ctl-solid); }
/* While the lens is up, the control's own outline would show through it. */
.seg[data-lens] { border-color: transparent; box-shadow: var(--elev-ctl); }
/* Narrow screens: the header may wrap, and the longer English title is set smaller. */
@media (max-width: 640px) {
  .top { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 10px 12px; }
  html:not([lang="ko"]) .top .brand { font-size: 22px; }
}

/* Mobile settings: a floating glass button (bottom right) and the sheet it opens. */
.fab, .sheet { display: none; }
@media (max-width: 640px) {
  .tools { display: none; }
  .top { height: 64px; padding: 0; }
  .wrap { padding-bottom: 96px; }
  .fab { display: grid; place-items: center; position: fixed; z-index: 30; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); width: 52px; height: 52px; padding: 0; border-radius: 999px; color: var(--label); cursor: pointer; font: inherit; }
  .fab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .fab:active { scale: .94; }
  .sheet { display: block; position: fixed; z-index: 29; right: max(16px, env(safe-area-inset-right)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 64px); width: min(340px, calc(100vw - 32px)); padding: 20px; border-radius: 22px; transform-origin: bottom right; opacity: 0; transform: scale(.92) translateY(10px); pointer-events: none; visibility: hidden;
    transition: opacity var(--motion-base) var(--ease-fade), transform var(--motion-base) var(--ease-travel), visibility 0s linear var(--motion-base); }
  .sheet.open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
  .sheet h2 { margin-bottom: 10px; }
  .tcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .tcard { display: grid; gap: 8px; justify-items: center; padding: 0; border: 0; background: none; color: var(--label); font: inherit; font-size: 14px; cursor: pointer; }
  .tcard[aria-checked="true"] { font-weight: 600; }
  .tprev { width: 100%; aspect-ratio: 3 / 2; border-radius: 10px; border: 2px solid transparent; box-shadow: 0 0 0 .5px var(--edge); }
  .tcard[aria-checked="true"] .tprev { border-color: var(--accent); }
  .tcard:focus-visible .tprev { outline: 2px solid var(--accent); outline-offset: 2px; }
  .p-light { background: linear-gradient(#fff, #fff) 38% 14% / 52% 72% no-repeat, linear-gradient(#e6e6eb, #e6e6eb) 8% 14% / 24% 72% no-repeat, #d9d9de; }
  .p-dark { background: linear-gradient(#1c1c1e, #1c1c1e) 38% 14% / 52% 72% no-repeat, linear-gradient(#2c2c2e, #2c2c2e) 8% 14% / 24% 72% no-repeat, #0c0c0e; }
  .p-system { background: linear-gradient(90deg, #fff 0 50%, #1c1c1e 50% 100%) 38% 14% / 52% 72% no-repeat, linear-gradient(90deg, #e6e6eb 0 50%, #0c0c0e 50% 100%); }
  .langslot .lang { display: block; width: 100%; }
  .langslot .lang-btn { width: 100%; }
  .langslot }
@media (prefers-reduced-motion: reduce) { .sheet { transition: none; } .fab:active { scale: none; } }


/* <language-select>: the trigger is a glass capsule; the open list is SaltyMail's menu.
   Trigger and list move together: pressing dips the trigger, its chevron turns, the list grows out of
   the trigger's edge (a clip that opens with a scale from that corner), and the rows follow one by one. */
.lang { position: relative; display: inline-block; }
.lang-btn { gap: 8px; padding: 0 14px 0 12px; font: inherit; cursor: pointer; }
.lang-btn:focus-visible { outline: 2px solid var(--accent); }
.lang-btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lang-btn .globe { color: var(--sub); }
.lang-btn .chev { width: 14px; height: 14px; color: var(--sub); margin-left: 2px; transition: transform var(--motion-base) var(--ease-travel); }
.lang-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.lang-btn[aria-expanded="true"] { scale: .97; box-shadow: inset 0 1px 0 var(--rim), inset 0 0 0 .5px var(--edge), 0 1px 2px rgba(0,0,0,.05); }
.lang-value { flex: 1; text-align: left; white-space: nowrap; }
.lang-menu { display: none; position: absolute; z-index: 40; box-sizing: border-box; min-width: max(100%, 200px); width: max-content; overflow-y: auto; padding: 4px; border-radius: 14px; outline: 0; color: var(--label);
  background: var(--card);
  border: .5px solid var(--edge); box-shadow: var(--elev-panel); }
.lang-menu[data-side="bottom"] { top: calc(100% + 8px); }
.lang-menu[data-side="top"] { bottom: calc(100% + 8px); }
.lang-menu[data-align="end"] { right: 0; }
.lang-menu[data-align="start"] { left: 0; }
.lang-menu[data-side="bottom"][data-align="end"] { transform-origin: top right; }
.lang-menu[data-side="bottom"][data-align="start"] { transform-origin: top left; }
.lang-menu[data-side="top"][data-align="end"] { transform-origin: bottom right; }
.lang-menu[data-side="top"][data-align="start"] { transform-origin: bottom left; }
.lang-menu[data-state="open"], .lang-menu[data-state="closing"] { display: block; }
.lang-menu[data-state="open"][data-side="bottom"] { animation: lang-open-down var(--motion-base) var(--ease-travel); }
.lang-menu[data-state="open"][data-side="top"] { animation: lang-open-up var(--motion-base) var(--ease-travel); }
.lang-menu[data-state="closing"] { pointer-events: none; animation: lang-close var(--motion-quick) var(--ease-fade) forwards; }
.lang-menu[data-state="open"] .lang-item { animation: lang-row var(--motion-base) var(--ease-travel) both; animation-delay: calc(var(--i, 0) * 32ms + 50ms); }
.lang-item { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 6px 10px; border-radius: 10px; font-size: 15px; cursor: pointer; user-select: none; white-space: nowrap; }
.lang-item[data-highlighted] { background: var(--accent-fill); color: #fff; }
.lang-tick { display: grid; place-items: center; width: 16px; height: 16px; flex: none; color: var(--accent); visibility: hidden; }
.lang-tick svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.lang-item[aria-selected="true"] .lang-tick { visibility: visible; }
.lang-item[data-highlighted] .lang-tick { color: #fff; }
@keyframes lang-open-down { from { opacity: 0; transform: scale(.55); clip-path: inset(0 0 72% 0 round 14px); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0 round 14px); } }
@keyframes lang-open-up { from { opacity: 0; transform: scale(.55); clip-path: inset(72% 0 0 0 round 14px); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0 round 14px); } }
@keyframes lang-close { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.9); } }
@keyframes lang-row { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .lang-menu[data-state="open"], .lang-menu[data-state="closing"], .lang-menu[data-state="open"] .lang-item { animation: none; }
  .lang-btn .chev { transition: none; }
  .lang-btn[aria-expanded="true"] { scale: none; }
}

/* The directory listing (directory.html), laid out as KAIST's: a title, then File Name / File Size /
   Date with the sort arrows, the parent first, striped rows. */
.dir { padding: 20px 24px 24px; }
.dir-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 14px; overflow-wrap: anywhere; }
.crumbs { font-family: var(--mono); font-weight: 600; font-size: .92em; }
.crumbs a { color: var(--accent); }
.dir-wrap { border: 1px solid var(--sep-strong); border-radius: 10px; overflow: hidden; }
.dir-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.dir-table .k-size { width: 120px; }
.dir-table .k-date { width: 150px; }
.dir-table th { text-align: left; font-weight: 600; padding: 6px 12px; background: var(--head); border-bottom: 1px solid var(--sep-strong); white-space: nowrap; }
.dir-table td { padding: 5px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dir-table tbody tr:nth-child(even) { background: var(--hover); }
.dir-table .c-size, .dir-table .c-date { color: var(--sub); }
.dir-table .c-name a { color: var(--accent); }
.dir-state { text-align: center; color: var(--sub); padding: 22px 12px; }
.sort-l, .sort-d { font: inherit; color: inherit; background: none; border: 0; padding: 1px 3px; cursor: pointer; border-radius: 6px; transition: color var(--motion-quick) var(--ease-fade); }
.sort-d { display: inline-grid; place-items: center; vertical-align: middle; }
.sort-d svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sort-l:hover, .sort-d:hover { color: var(--accent); }
.sort-l:focus-visible, .sort-d:focus-visible { outline: 2px solid var(--accent); }
.dir-table th[aria-sort="ascending"] .sort-l, .dir-table th[aria-sort="descending"] .sort-d { color: var(--accent); }
@media (max-width: 640px) {
  .dir { padding: 16px 12px 18px; }
  .dir-title { font-size: 17px; }
  .dir-table { font-size: 13px; }
  .dir-table th, .dir-table td { padding: 6px 8px; }
  .dir-table .k-size, .dir-table th.size, .dir-table td.c-size { display: none; }
  .dir-table .k-date { width: 136px; }
}
