/* OPTICA IIITA Student Chapter — site styles */
:root {
  --navy: #0E1A4F;
  --navy-2: #16246A;
  --ink: #0A0F2C;
  --black: #000000;
  --paper: #FFFFFF;
  --mist: #F2F4FA;
  --line: #D9DEEE;
  --muted: #4A5375;
  --violet: #6B2BD9;
  --blue: #1F5FD6;
  --on-navy: #E8ECFA;
  --on-navy-muted: #A9B3DA;

  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;

  --step--1: 0.9rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.1rem;
  --step-4: clamp(2.4rem, 5.2vw, 4.1rem);

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius-photo: 50%;
  --radius-panel: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--violet); }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h2 { font-size: var(--step-3); font-weight: 650; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: 66ch; }
.lede { font-size: var(--step-1); color: var(--muted); line-height: 1.55; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { height: 40px; width: auto; }
.brand .emblem { height: 40px; border-left: 1px solid var(--line); padding-left: 14px; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { font-family: var(--font-display); font-size: .95rem; font-weight: 500; color: var(--ink); text-decoration: none; padding: 10px 14px; border-radius: 8px; }
.nav a:hover { background: var(--mist); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--violet); box-shadow: inset 0 -2px 0 var(--violet); border-radius: 0; }
.nav .nav-cta { background: var(--navy); color: var(--paper); margin-left: 8px; }
.nav .nav-cta:hover { background: var(--navy-2); color: var(--paper); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font: 600 .95rem var(--font-display); color: var(--ink); cursor: pointer; }

@media (max-width: 880px) {
  .brand img { height: 32px; }
  .brand .emblem { display: none; }
  .menu-btn { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); flex-direction: column; align-items: stretch; padding: 8px var(--gutter) 16px; border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 8px; }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--violet); padding-left: 14px; }
  .nav .nav-cta { margin: 8px 0 0; text-align: center; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; font: 600 1rem var(--font-display); padding: 14px 22px; border-radius: 10px; text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.btn-light { background: var(--paper); color: var(--navy); }
.btn-light:hover { background: var(--mist); color: var(--navy); }
.btn-ghost { border-color: rgba(232,236,250,.45); color: var(--on-navy); }
.btn-ghost:hover { border-color: var(--on-navy); color: var(--paper); }
.btn-dark { background: var(--navy); color: var(--paper); }
.btn-dark:hover { background: var(--violet); color: var(--paper); }
.btn-outline { border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--paper); }

/* ---------- Hero (home) ---------- */
.hero { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 85% 40%, #1B2C7A 0%, var(--navy) 55%, #0A1340 100%); color: var(--on-navy); }
.hero .wrap { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; align-items: center; padding-top: clamp(56px, 8vw, 104px); padding-bottom: clamp(56px, 8vw, 104px); }
.hero .presents { font-family: var(--font-display); font-size: var(--step--1); color: var(--on-navy-muted); margin-bottom: 18px; }
.hero h1 { font-size: var(--step-4); font-weight: 700; color: var(--paper); letter-spacing: -0.025em; line-height: 1.04; margin-bottom: 22px; }
.hero h1 .year { display: block; font-weight: 300; color: var(--on-navy-muted); }
.hero .summary { font-size: var(--step-1); color: var(--on-navy); max-width: 34ch; line-height: 1.5; }
.facts { list-style: none; padding: 0; margin: 28px 0 32px; display: grid; gap: 10px; }
.facts li { display: flex; gap: 14px; align-items: baseline; }
.facts dt, .facts .k { font-family: var(--font-display); font-size: var(--step--1); color: var(--on-navy-muted); min-width: 6.2em; flex-shrink: 0; }
.facts .v { font-family: var(--font-display); font-weight: 600; color: var(--paper); font-size: 1.1rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.countdown { margin-top: 22px; font-size: var(--step--1); color: var(--on-navy-muted); min-height: 1.6em; }
.countdown strong { color: var(--paper); font-weight: 600; }

.prism { width: 100%; height: auto; overflow: visible; }
.prism .beam { stroke-dasharray: 520; stroke-dashoffset: 520; animation: draw .9s .2s cubic-bezier(.4,0,.2,1) forwards; }
.prism .glass { opacity: 0; animation: fade .6s .8s ease forwards; }
.prism .rays { transform-origin: 318px 236px; transform: scaleX(0); animation: spread 1.1s 1.05s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes spread { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .prism .beam { animation: none; stroke-dashoffset: 0; }
  .prism .glass { animation: none; opacity: 1; }
  .prism .rays { animation: none; transform: none; }
}
@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 8px; }
  .hero .prism-wrap { order: -1; width: 78%; max-width: 380px; margin: -24px 0 0 -8%; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-mist { background: var(--mist); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 40px; align-items: end; margin-bottom: 48px; }
.section-head p { color: var(--muted); margin: 0; }
@media (max-width: 880px) { .section-head { grid-template-columns: 1fr; gap: 12px; margin-bottom: 32px; } }

/* Workshop theme */
.theme { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.theme blockquote { margin: 0; font-family: var(--font-display); font-size: clamp(1.15rem, 1.7vw, 1.4rem); line-height: 1.5; font-weight: 400; color: var(--ink); }
.theme .verbs { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 28px; font-family: var(--font-display); font-weight: 600; color: var(--violet); }
.topics { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; }
.topics li { display: grid; grid-template-columns: 88px 1fr; gap: 18px; align-items: center; }
.topics img { width: 88px; height: 88px; border-radius: var(--radius-photo); object-fit: cover; }
.topics h3 { margin: 0 0 2px; }
.topics p { margin: 0; color: var(--muted); font-size: .98rem; }
@media (max-width: 880px) { .theme { grid-template-columns: 1fr; } }

/* People */
.coordinator { display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: center; padding: 28px; background: var(--navy); color: var(--on-navy); border-radius: var(--radius-panel); margin-bottom: 56px; }
.coordinator img { width: 200px; height: 200px; border-radius: var(--radius-photo); object-fit: cover; border: 4px solid rgba(255,255,255,.12); }
.coordinator .role { font-family: var(--font-display); font-size: var(--step--1); color: var(--on-navy-muted); margin-bottom: 6px; }
.coordinator h3 { font-size: var(--step-2); color: var(--paper); margin-bottom: 6px; }
.coordinator p { margin: 0 0 4px; }
.coordinator a { color: var(--paper); }
@media (max-width: 640px) { .coordinator { grid-template-columns: 1fr; text-align: left; } .coordinator img { width: 140px; height: 140px; } }

.people { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 36px 24px; }
.person img, .person .initials { width: 148px; height: 148px; border-radius: var(--radius-photo); object-fit: cover; margin-bottom: 16px; background: var(--mist); }
.person .initials { display: grid; place-items: center; font: 600 2.2rem var(--font-display); color: var(--navy); background: #E3E7F6; }
.person h3 { font-size: 1.08rem; margin-bottom: 4px; }
.person p { margin: 0; color: var(--muted); font-size: .97rem; line-height: 1.45; }
.person .member-tag { display: inline-block; margin-top: 8px; font-family: var(--font-display); font-size: .8rem; font-weight: 600; color: var(--violet); background: #EFE7FD; padding: 3px 10px; border-radius: 99px; }
.person .note { margin-top: 8px; font-size: .9rem; color: var(--violet); }
.person a { text-decoration: none; color: inherit; }
.person a:hover h3 { color: var(--violet); }
.people.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.people.small img, .people.small .initials { width: 116px; height: 116px; }
@media (max-width: 480px) {
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .person img, .person .initials { width: 120px; height: 120px; }
  .people.small img, .people.small .initials { width: 100px; height: 100px; }
}

/* Venue band */
.venue { position: relative; color: var(--paper); background: var(--navy); }
.venue img { width: 100%; height: clamp(300px, 42vw, 520px); object-fit: cover; opacity: .55; }
.venue .wrap { position: absolute; inset: auto 0 0 0; padding-bottom: clamp(28px, 5vw, 56px); }
.venue .card { background: var(--paper); color: var(--ink); max-width: 460px; padding: 28px; border-radius: var(--radius-panel); }
.venue .card h2 { font-size: var(--step-2); }
.venue .card p { color: var(--muted); }
.venue .card p:last-child { margin: 0; }
@media (max-width: 640px) {
  .venue .wrap { position: relative; z-index: 1; padding-top: 0; margin-top: -60px; }
  .venue img { height: 240px; }
}

/* About chapter */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); }
.benefits { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.benefits li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.benefits strong { display: block; font-family: var(--font-display); font-weight: 600; margin-bottom: 2px; }
.benefits span { color: var(--muted); }
.links-inline { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
@media (max-width: 880px) { .about { grid-template-columns: 1fr; } }

/* Activity teasers */
.teasers { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.teasers img { width: 100%; aspect-ratio: 3/2; object-fit: cover; border-radius: 10px; margin-bottom: 14px; }
.teasers time { font-size: var(--step--1); color: var(--muted); }
.teasers h3 { font-size: 1.1rem; margin: 4px 0 0; }
.teasers a { color: inherit; text-decoration: none; }
.teasers a:hover h3 { color: var(--violet); }
@media (max-width: 880px) { .teasers { grid-template-columns: 1fr; } .teasers li { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; } .teasers img { margin: 0; } }
.more { margin-top: 36px; }

/* ---------- Page header (inner pages) ---------- */
.page-head { background: var(--navy); color: var(--on-navy); position: relative; overflow: hidden; }
.page-head .wrap { padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(40px, 6vw, 72px); position: relative; z-index: 1; }
.page-head h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); color: var(--paper); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }
.page-head p { max-width: 50ch; color: var(--on-navy-muted); font-size: var(--step-1); margin: 0; }
.page-head .spectrum { position: absolute; right: 0; bottom: 0; width: min(36%, 460px); height: 100%; pointer-events: none; }
@media (max-width: 720px) { .page-head .spectrum { width: 60%; opacity: .5; } }

/* ---------- Activities timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7.5rem; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.event { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0 40px; position: relative; padding-bottom: 64px; }
.event:last-child { padding-bottom: 0; }
.event::before { content: ""; position: absolute; left: calc(7.5rem - 6px); top: 8px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 3px solid var(--navy); }
.event.upcoming::before { background: var(--violet); border-color: var(--violet); box-shadow: 0 0 0 6px rgba(107,43,217,.15); }
.event .when { font-family: var(--font-display); font-weight: 600; font-size: .95rem; line-height: 1.3; padding-right: 20px; text-align: right; }
.event .when span { display: block; font-weight: 400; color: var(--muted); }
.event .body { padding-left: 4px; }
.event h2 { font-size: var(--step-2); margin-bottom: 8px; }
.event .tag { display: inline-block; font-family: var(--font-display); font-size: .82rem; font-weight: 600; color: var(--violet); background: #EFE7FD; padding: 3px 10px; border-radius: 99px; margin-bottom: 10px; }
.event p { color: var(--muted); max-width: 64ch; }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 18px; max-width: 760px; }
.gallery button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; overflow: hidden; aspect-ratio: 1; }
.gallery button:first-child { grid-column: span 2; grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery button:hover img { transform: scale(1.04); }
.gallery .more-count { position: relative; }
.gallery .more-count::after { content: attr(data-more); position: absolute; inset: 0; display: grid; place-items: center; background: rgba(14,26,79,.62); color: #fff; font: 600 1.2rem var(--font-display); }
.gallery button.hidden { display: none; }
@media (max-width: 720px) {
  .timeline::before { left: 6px; }
  .event { grid-template-columns: 1fr; padding-left: 32px; padding-bottom: 52px; }
  .event::before { left: 0; }
  .event .when { text-align: left; padding: 0 0 8px; }
  .event .when span { display: inline; margin-left: 6px; }
  .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .gallery button:first-child { grid-column: span 4; grid-row: auto; aspect-ratio: 3/2; }
}

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(5,9,30,.92); }
.lightbox .frame { width: 100%; height: 100%; display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lightbox img { max-width: 100%; max-height: 86vh; margin: auto; border-radius: 6px; }
.lightbox button { background: rgba(255,255,255,.1); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; margin: auto; }
.lightbox button:hover { background: rgba(255,255,255,.22); }
.lightbox .close { position: absolute; top: 16px; right: 16px; }
.lightbox .count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #C9D0EE; font: 500 .9rem var(--font-display); }
@media (max-width: 640px) { .lightbox .frame { grid-template-columns: 44px 1fr 44px; } .lightbox button { width: 40px; height: 40px; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 72px); }
.contact-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.contact-list li { padding: 22px 0; border-bottom: 1px solid var(--line); }
.contact-list h3 { font-size: 1.05rem; margin-bottom: 6px; }
.contact-list p { margin: 0; color: var(--muted); }
.contact-list a { font-weight: 600; }
.form { background: var(--mist); padding: clamp(22px, 4vw, 36px); border-radius: var(--radius-panel); }
.form h2 { font-size: var(--step-2); }
.form p.hint { color: var(--muted); font-size: .97rem; }
.field { margin-bottom: 18px; }
.field label { display: block; font: 600 .95rem var(--font-display); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid #C3CAE2; border-radius: 8px; background: var(--paper); color: var(--ink); }
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(107,43,217,.18); }
.map { margin-top: 40px; border-radius: var(--radius-panel); overflow: hidden; border: 1px solid var(--line); }
.map iframe { display: block; width: 100%; height: 360px; border: 0; }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }

/* Join box (team) */
.join { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; background: var(--mist); padding: 32px; border-radius: var(--radius-panel); }
.join h2 { font-size: var(--step-2); margin-bottom: 6px; }
.join p { margin: 0; color: var(--muted); }
@media (max-width: 720px) { .join { grid-template-columns: 1fr; } }
.subhead { font-size: var(--step-2); margin: 64px 0 28px; }
.subhead small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 1rem; color: var(--muted); margin-top: 6px; letter-spacing: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #C2C8E4; padding: 64px 0 28px; font-size: .97rem; }
.site-footer .grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-footer .wordmark { height: 30px; width: auto; filter: invert(1); margin-bottom: 14px; }
.site-footer h2 { font-size: 1rem; color: #fff; margin-bottom: 12px; font-weight: 600; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #E8ECFA; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .base { border-top: 1px solid rgba(255,255,255,.1); margin-top: 48px; padding-top: 22px; font-size: .88rem; color: #8F98C2; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer .spectrum-rule { height: 3px; background: linear-gradient(90deg, #ff3b3b, #ff8a1f, #ffd400, #3ddc84, #21b8ff, #3d5bff, #9b4dff); margin-bottom: 48px; border-radius: 2px; max-width: 160px; }
@media (max-width: 880px) { .site-footer .grid { grid-template-columns: 1fr; gap: 28px; } }

/* Registration */
.reg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.reg-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: clamp(22px, 3vw, 32px); }
.reg-card:first-child { border: 2px solid var(--violet); }
.reg-card h3 { font-size: var(--step-1); margin-bottom: 4px; }
.reg-card .reg-mode { font-family: var(--font-display); font-weight: 600; color: var(--violet); margin-bottom: 12px; }
.reg-card p { color: var(--muted); }
.reg-card .btn { margin-top: 4px; }
.reg-url { font-size: .85rem; margin: 14px 0 0; word-break: break-all; }
.reg-status:empty { display: none; }
.reg-status { margin: 12px 0 0; font-weight: 600; color: var(--ink); }
@media (max-width: 720px) { .reg { grid-template-columns: 1fr; } }

/* Gallery variants */
.gallery.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery.two button, .gallery.two button:first-child { grid-column: auto; grid-row: auto; aspect-ratio: 4/3; }
.gallery.four button:last-child { grid-column: span 2; aspect-ratio: 2/1; }
@media (max-width: 720px) {
  .gallery.two button:first-child { grid-column: auto; aspect-ratio: 4/3; }
}
