/* =====================================================================
   Open Source Resources - Computer Centre, IIT Kanpur
   Palette kept from the original site: #f16529 / #e44d26 on white.
   No external fonts or CDNs (privacy + strict CSP).
   ===================================================================== */

:root {
  --orange: #f16529;
  --orange-dark: #e44d26;
  --orange-deep: #b8381a;     /* AA-contrast text on white */
  --orange-50: #fff4ee;
  --orange-100: #ffe5d8;
  --orange-200: #fbc9b0;
  --ink: #1d1f23;
  --ink-2: #464b53;
  --muted: #6a707a;
  --line: #efe4dd;
  --bg: #fffaf7;
  --surface: #ffffff;
  --term: #23170f;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(60, 25, 10, .06), 0 1px 3px rgba(60, 25, 10, .08);
  --shadow: 0 10px 30px -12px rgba(160, 50, 15, .25), 0 2px 6px rgba(60, 25, 10, .06);
  --maxw: 1160px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "DejaVu Sans Mono", Menlo, Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font: 16px/1.6 var(--font);
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--orange-deep); text-underline-offset: 3px; }
a:hover { color: var(--orange-dark); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--orange-200); }

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.2em; }
.icon--sm { width: 1em; height: 1em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--orange);
  border-bottom: 6px solid var(--orange-dark);
  box-shadow: 0 4px 14px rgba(160, 50, 15, .18);
}
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; margin-right: auto; }
.brand:hover { color: #fff; }
.brand__mark { width: 40px; height: 40px; border-radius: 10px; background: var(--orange-dark); display: grid; place-items: center; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.brand__mark .icon { width: 22px; height: 22px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__title { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.brand__sub { font-size: .78rem; opacity: .92; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav a {
  display: block; padding: 9px 14px; border-radius: 999px;
  color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem;
}
.site-nav a:hover { background: rgba(255,255,255,.16); color: #fff; }
.site-nav a[aria-current="page"] { background: var(--orange-dark); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }

.nav-toggle { display: none; background: var(--orange-dark); color: #fff; border: 0; border-radius: 10px; width: 44px; height: 44px; cursor: pointer; }
.nav-toggle .icon { width: 22px; height: 22px; }

@media (max-width: 820px) {
  .js .nav-toggle { display: grid; place-items: center; }
  .site-header .container { flex-wrap: wrap; }
  .site-nav { width: 100%; }
  .site-nav ul { flex-wrap: wrap; padding-bottom: 10px; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; }
  .brand__sub { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: #fff;
}
.hero::after { /* subtle grid pattern */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 90%);
          mask-image: linear-gradient(to bottom, #000, transparent 90%);
}
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 72px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; background: rgba(0,0,0,.14); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); font-weight: 800; margin-bottom: 16px; }
.hero p.lead { font-size: 1.12rem; max-width: 36em; opacity: .96; margin-bottom: 28px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-weight: 700; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn--light { background: #fff; color: var(--orange-deep); box-shadow: 0 6px 16px rgba(80, 20, 0, .2); }
.btn--light:hover { color: var(--orange-dark); }
.btn--ghost { color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
.btn--ghost:hover { color: #fff; background: rgba(255,255,255,.12); }

.terminal { background: var(--term); color: #f3e6dc; border-radius: var(--radius); box-shadow: 0 30px 60px -20px rgba(50, 10, 0, .55); font: .88rem/1.7 var(--mono); overflow: hidden; }
.terminal__bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: rgba(255,255,255,.06); }
.terminal__bar i { width: 11px; height: 11px; border-radius: 50%; background: #5a4a40; }
.terminal__bar i:first-child { background: var(--orange); }
.terminal__bar span { margin-left: 10px; font-size: .78rem; color: #b9a697; }
.terminal__body { padding: 16px 18px 20px; min-height: 180px; }
.term__prompt { color: #ffb38d; }
.term__line { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term__date { color: #b9a697; }
.term__cat { color: #ffb38d; }
.term__muted { color: #b9a697; }
.term__cursor { display: inline-block; width: .6em; height: 1.1em; background: #ffb38d; vertical-align: -.2em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section--tint { background: var(--orange-50); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section--quick { padding: 32px 0; }
.section--quick .kicker { margin: 0 0 14px; }
.cards.cards--quick { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cards--quick .card { border-left: 4px solid var(--orange); }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 32px; }
.section__head h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 800; margin: 0; }
.section__head p { margin: 6px 0 0; color: var(--muted); }
.kicker { display: block; color: var(--orange-deep); font-weight: 700; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Resource cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--orange-200); color: var(--ink); }
.card__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--orange-100); color: var(--orange-dark); display: grid; place-items: center; flex: none; }
.card__icon .icon { width: 22px; height: 22px; }
.card__title { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 2px; }
.card__title .icon { color: var(--muted); width: .9em; height: .9em; }
.card__desc { color: var(--muted); font-size: .9rem; line-height: 1.45; margin: 0; }
.card__host { display: block; font: .75rem var(--mono); color: var(--orange-deep); margin-top: 6px; word-break: break-all; }

.group + .group { margin-top: 40px; }
.group__title { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 800; margin-bottom: 14px; }
.group__title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Notice board ---------- */
.board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; overflow: hidden;
  border-top: 5px solid var(--orange);
}
.panel--security { border-top-color: var(--orange-dark); }
.panel--linux { border-top-color: var(--orange); }
.panel--cc { border-top-color: var(--orange-deep); }
.panel--general { border-top-color: #f59a6b; }
.panel__head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.panel__icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--orange-100); color: var(--orange-dark); flex: none; }
.panel--security .panel__icon { background: var(--orange-dark); color: #fff; }
.panel__head h3 { font-size: 1.08rem; margin: 0; flex: 1; }
.panel__count { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--orange-50); color: var(--orange-deep); font-weight: 800; font-size: .85rem; display: grid; place-items: center; border: 1px solid var(--orange-200); }
.panel__list { list-style: none; margin: 0; padding: 6px 20px; flex: 1; max-height: 420px; overflow-y: auto; }
.panel__foot { padding: 12px 20px; border-top: 1px solid var(--line); background: #fffdfb; font-size: .9rem; }

.post { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.post:last-child { border-bottom: 0; }
.post__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.post__date { font: 600 .78rem var(--mono); color: var(--muted); }
.post__text { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.post__link { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-weight: 600; font-size: .9rem; text-decoration: none; }
.post__link:hover { text-decoration: underline; }
.post--important { background: var(--orange-50); margin: 8px -12px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--orange-200); }
.post--important .post__text { color: var(--ink); font-weight: 600; }
.post--empty, .post--more { color: var(--muted); font-style: italic; }
.post--loading { color: var(--muted); }

.badge { font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.badge--new { background: var(--orange); color: #fff; }
.badge--important { background: var(--orange-dark); color: #fff; }
.badge--lan { background: var(--orange-50); color: var(--orange-deep); border: 1px solid var(--orange-200); white-space: nowrap; }
.card__title { flex-wrap: wrap; row-gap: 2px; }
.card__title .badge--lan { font-size: .62rem; }
.btn .badge--lan { margin-left: 2px; }
.tag { font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--orange-100); color: var(--orange-deep); }
.tag--security { background: var(--orange-dark); color: #fff; }

.board-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: var(--muted); font-size: .9rem; }

/* ---------- Security tips strip ---------- */
.tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tip { display: flex; gap: 14px; background: var(--surface); border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); }
.tip .icon { color: var(--orange-dark); width: 26px; height: 26px; }
.tip h3 { font-size: 1rem; margin-bottom: 4px; }
.tip p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- Page header (inner pages) ---------- */
.page-head { background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%); color: #fff; padding: 44px 0 40px; }
.page-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; margin-bottom: 6px; }
.page-head p { margin: 0; opacity: .95; max-width: 46em; }

/* ---------- Labs ---------- */
.embed { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.embed__bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.embed iframe { display: block; width: 100%; height: 78vh; min-height: 520px; border: 0; }

/* ---------- Archive ---------- */
.archive { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.months { position: sticky; top: 96px; list-style: none; margin: 0; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-height: calc(100vh - 120px); overflow-y: auto; }
.months__year { font-weight: 800; font-size: .8rem; letter-spacing: .08em; color: var(--muted); padding: 10px 10px 4px; }
.months__btn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 12px; border: 0; border-radius: var(--radius-sm); background: none; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.months__btn:hover { background: var(--orange-50); }
.months__btn[aria-current="true"] { background: var(--orange); color: #fff; font-weight: 700; }
.months__count { font-size: .78rem; font-weight: 700; padding: 0 8px; border-radius: 999px; background: var(--orange-50); color: var(--orange-deep); }
.months__btn[aria-current="true"] .months__count { background: rgba(255,255,255,.25); color: #fff; }
.months__empty { color: var(--muted); padding: 8px 10px; font-style: italic; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.chip { border: 1px solid var(--orange-200); background: var(--surface); color: var(--orange-deep); border-radius: 999px; padding: 7px 14px; font: 600 .88rem var(--font); cursor: pointer; }
.chip:hover { background: var(--orange-50); }
.chip[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: #fff; }
.search { position: relative; margin-left: auto; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { font: inherit; padding: 9px 14px 9px 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); width: 240px; max-width: 100%; }
.search input:focus { outline: 3px solid var(--orange-200); border-color: var(--orange); }
.archive__panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.archive__panel h2 { font-size: 1.4rem; margin: 0; }
.archive__status { color: var(--muted); font-size: .88rem; }
.archive__list { list-style: none; margin: 10px 0 0; padding: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--orange-dark); color: #fff; margin-top: 0; }
.site-footer a { color: #fff; }
.site-footer .container { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-top: 44px; padding-bottom: 28px; }
.site-footer h2 { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; opacity: .9; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer p { opacity: .95; margin: 0 0 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.25); }
.footer-bottom .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 14px; padding-bottom: 16px; font-size: .88rem; grid-template-columns: none; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 96px 0; }
.notfound .code { font: 800 5rem/1 var(--mono); color: var(--orange); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero .container { grid-template-columns: 1fr; gap: 32px; padding-top: 44px; padding-bottom: 52px; }
  .tips { grid-template-columns: 1fr; }
  .archive { grid-template-columns: 1fr; }
  .months { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; }
  .months li { flex: none; }
  .months__year { width: 100%; }
  .site-footer .container { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .board { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .site-footer .container { grid-template-columns: 1fr; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; }
  .container { padding: 0 16px; }
}

@media print {
  .site-header, .site-footer, .hero .terminal, .nav-toggle { display: none; }
  .panel__list { max-height: none; overflow: visible; }
}
