/* DLIHM - IIT Delhi Open House 2026 */

:root {
  --bg: #f7f7f4;
  --panel: #ffffff;
  --ink: #1d2328;
  --muted: #56616b;
  --faint: #8a949c;
  --rule: #dde1dc;
  --green: #2f6b2a;
  --green-soft: #e8f1e5;
  --navy: #1f3f6b;
  --navy-soft: #e7edf5;
  --amber: #9a6a00;
  --dark: #0d1014;

  --font-body: 'Source Sans 3', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 17px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: var(--navy); }
a:hover { color: var(--green); }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; color: var(--ink); }
h3 { font-size: 1.2rem; margin: 28px 0 10px; }
h4 { font-size: 1.02rem; margin: 18px 0 6px; }
p { margin: 0 0 12px; }
p.lead { font-size: 1.08rem; color: var(--ink); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: 0.88em; }
ul.plain { margin: 6px 0 12px 1.2em; }
ul.plain li { margin-bottom: 4px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--rule);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { height: 42px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--font-head); font-size: 1.02rem; }
.brand-text span { font-size: 0.8rem; color: var(--muted); }
.header-link { font-size: 0.88rem; font-family: var(--font-mono); white-space: nowrap; }

/* Hero */
.hero { padding: 48px 0 28px; border-bottom: 1px solid var(--rule); background: var(--panel); }
.event-line { font-size: 0.9rem; color: var(--green); font-weight: 600; letter-spacing: 0.02em; margin-bottom: 10px; }
.hero h1 { font-size: 2.4rem; margin-bottom: 6px; }
.hero h1 .sub { display: block; font-size: 1.45rem; font-weight: 500; color: var(--muted); margin-top: 4px; }
.authors { margin: 16px 0 20px; }
.authors strong { font-size: 1.05rem; }
.authors span { display: block; color: var(--muted); font-size: 0.95rem; }

.toc { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 22px; padding: 0; list-style: none; }
.toc a {
  display: inline-block; padding: 5px 11px; border: 1px solid var(--rule); border-radius: 999px;
  font-size: 0.86rem; text-decoration: none; color: var(--ink); background: var(--bg);
}
.toc a:hover { border-color: var(--green); color: var(--green); }

/* Sections */
.section { padding: 56px 0 24px; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { margin-bottom: 22px; max-width: 820px; }
.section-num { font-family: var(--font-mono); font-size: 0.82rem; color: var(--green); font-weight: 600; }
.section-head h2 { font-size: 1.85rem; margin: 2px 0 8px; }
.section-head p { color: var(--muted); font-size: 1.02rem; margin: 0; }

.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 26px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.two-col > * { min-width: 0; }

/* Figures */
figure.fig { margin: 18px 0; }
figure.fig .fig-frame {
  border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: #fff; cursor: zoom-in;
}
figure.fig .fig-frame.dark { background: var(--dark); }
figure.fig img { width: 100%; height: auto; }
figure.fig figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 8px; line-height: 1.5; }
figure.fig figcaption b { color: var(--ink); }

/* Tables */
table.data { width: 100%; border-collapse: collapse; font-size: 0.94rem; margin: 10px 0 6px; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data th { font-weight: 600; background: var(--bg); }
table.data td.num { font-family: var(--font-mono); font-size: 0.86rem; white-space: nowrap; }
table.data tr.ours td { background: var(--green-soft); }
.table-wrap { overflow-x: auto; }

/* Math */
.math-box {
  background: var(--bg); border-left: 3px solid var(--navy); border-radius: 4px;
  padding: 10px 16px; margin: 12px 0; overflow-x: auto;
}
.katex { font-size: 1.05em; }
.katex-display { margin: 6px 0 !important; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }

.note {
  background: var(--navy-soft); border-radius: 6px; padding: 12px 16px; font-size: 0.94rem; margin: 14px 0;
}
.note.green { background: var(--green-soft); }

/* Accordions (limitations, FAQ) */
details.acc { border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); margin-bottom: 8px; }
details.acc summary {
  cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; display: flex;
  justify-content: space-between; gap: 12px;
}
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: '+'; color: var(--green); font-family: var(--font-mono); }
details.acc[open] summary::after { content: '\2212'; }
details.acc .acc-body { padding: 0 16px 14px; color: var(--muted); font-size: 0.96rem; }

/* Tabs / segmented buttons */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.seg button {
  font: inherit; font-size: 0.9rem; padding: 7px 13px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--panel); color: var(--ink);
}
.seg button:hover { border-color: var(--green); }
.seg button.active { background: var(--green); border-color: var(--green); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Diffraction simulator */
.sim-z-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sim-z-value { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 600; color: var(--green); }
.sim-regime { font-size: 0.95rem; color: var(--muted); }
.slider-wrap { position: relative; margin: 10px 0 4px; padding-top: 16px; }
.slider-band {
  position: absolute; top: 0; height: 12px; border-radius: 3px; background: var(--green-soft);
  border: 1px solid #b9d3b2; font-size: 0.68rem; color: var(--green); line-height: 10px; padding: 0 4px;
  white-space: nowrap; overflow: hidden;
}
.slider-ticks { position: relative; height: 18px; margin: 0 10px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); }
.slider-ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; background: var(--rule); border-radius: 3px; outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--green); cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--green); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--green); cursor: pointer; border: 2px solid #fff; }
input[type="range"]:focus-visible { box-shadow: 0 0 0 3px var(--green-soft); }

.sim-views { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.sim-view h4 { margin: 0 0 6px; font-family: var(--font-body); font-size: 0.95rem; }
.sim-img-box { position: relative; aspect-ratio: 1 / 1; background: var(--dark); border-radius: 6px; overflow: hidden; }
.sim-img-box img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
/* spans the full image width so the bar's % width is a fraction of the field of view */
.scalebar { position: absolute; left: 0; right: 0; bottom: 10px; padding-left: 12px; color: #fff; font-family: var(--font-mono); font-size: 0.74rem; text-shadow: 0 1px 2px #000; pointer-events: none; }
.scalebar i { display: block; height: 4px; background: #fff; margin-bottom: 3px; box-shadow: 0 1px 2px #000; }
.sim-caption { font-size: 0.86rem; color: var(--muted); margin-top: 6px; }
.colorbar { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); margin-top: 6px; }
.colorbar i { flex: 1; height: 8px; border-radius: 2px; background: linear-gradient(90deg, #440154, #3b528b, #21918c, #5ec962, #fde725); }
.colorbar.gray i { background: linear-gradient(90deg, #000, #fff); }
.profile-box { margin-top: 16px; border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); height: 120px; }
.profile-box canvas { width: 100%; height: 100%; display: block; }
.sim-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.fact { border: 1px solid var(--rule); border-radius: 6px; padding: 8px 12px; background: var(--bg); }
.fact span { display: block; font-size: 0.76rem; color: var(--muted); }
.fact b { font-family: var(--font-mono); font-size: 0.92rem; font-weight: 600; }

/* Refocusing */
.refocus-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px; align-items: start; }
.refocus-screen { position: relative; background: #f0f0f0; border-radius: 6px; overflow: hidden; border: 1px solid var(--rule); }
.refocus-screen img { width: 100%; height: auto; }
.focus-pill {
  position: absolute; top: 10px; right: 10px; font-family: var(--font-mono); font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--rule); padding: 3px 10px; border-radius: 999px;
}
.focus-pill.in-focus { color: var(--green); border-color: var(--green); }
.chart-box { border: 1px solid var(--rule); border-radius: 6px; background: var(--panel); height: 230px; margin-top: 12px; }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.btn {
  font: inherit; font-size: 0.92rem; font-weight: 600; padding: 8px 16px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--green); background: var(--green); color: #fff; margin-top: 12px;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-outline {
  display: inline-block; font-size: 0.92rem; font-weight: 600; padding: 7px 14px; border-radius: 6px;
  border: 1px solid var(--navy); color: var(--navy); text-decoration: none; margin: 4px 8px 4px 0;
}
.btn-outline:hover { background: var(--navy-soft); color: var(--navy); }

/* Paper block */
.paper-ref { border-left: 3px solid var(--green); padding: 4px 0 4px 16px; margin-bottom: 18px; }
.paper-ref .venue { font-family: var(--font-mono); font-size: 0.84rem; color: var(--green); }
.paper-ref .title { font-family: var(--font-head); font-size: 1.22rem; font-weight: 600; margin: 4px 0; }
.paper-ref .who { color: var(--muted); font-size: 0.95rem; }
.sub-head { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--navy); margin: 34px 0 4px; }
.sub-head:first-of-type { margin-top: 8px; }
.copyright { font-size: 0.82rem; color: var(--faint); margin-top: 16px; }

/* Applications */
.app-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.app-card { border: 1px solid var(--rule); border-radius: 6px; padding: 14px 16px; background: var(--panel); }
.app-card h4 { margin: 0 0 4px; }
.app-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Lightbox */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 15, 0.92);
  align-items: center; justify-content: center; flex-direction: column; padding: 20px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 86vh; object-fit: contain; background: #fff; border-radius: 4px; }
.lightbox p { color: #e6e6e6; font-size: 0.92rem; margin-top: 10px; max-width: 900px; text-align: center; }
.lightbox button {
  position: absolute; top: 14px; right: 18px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid #666; background: #222; color: #fff; font-size: 1.2rem; cursor: pointer;
}

/* Footer */
footer { margin-top: 48px; border-top: 1px solid var(--rule); background: var(--panel); padding: 30px 0 22px; font-size: 0.92rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; }
footer h4 { margin: 0 0 6px; font-size: 1rem; }
footer ul { list-style: none; }
footer li { margin-bottom: 4px; }
.footer-bottom { margin-top: 20px; color: var(--faint); font-size: 0.84rem; }

@media (max-width: 860px) {
  .two-col, .sim-views, .refocus-grid, .app-grid, .footer-grid { grid-template-columns: 1fr; }
  .sim-facts { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 1.9rem; }
  .hero h1 .sub { font-size: 1.15rem; }
  .header-link { display: none; }
}
@media (max-width: 520px) {
  html { font-size: 16px; }
  .panel { padding: 16px; }
  .brand-text span { display: none; }
}
