/* ==========================================================================
   Anik Chakraborty — portfolio
   Field-notebook theme: paper, stamps, index cards, handwritten annotations.
   ========================================================================== */

:root {
  --paper: oklch(97% 0.012 85);
  --paper-card: oklch(99% 0.006 85);
  --paper-alt: oklch(94% 0.02 80);
  --ink: oklch(20% 0.01 60);
  --ink-soft: oklch(30% 0.015 60);
  --ink-muted: oklch(45% 0.012 60);
  --ink-faint: oklch(50% 0.01 60);
  --accent: #B23A2E;
  --blue: oklch(45% 0.13 250);

  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-serif: "Lora", Georgia, "Times New Roman", serif;
  --font-hand: "Caveat", cursive;

  --max-width: 1220px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  z-index: 100;
  font-family: var(--font-mono);
  font-size: 13px;
}
.skip-link:focus { left: 12px; top: 12px; }

::selection { background: color-mix(in oklch, var(--accent) 30%, transparent); }

.mono { font-family: var(--font-mono); }
.hand { font-family: var(--font-hand); color: var(--blue); }

.eyebrow {
  font-size: clamp(24px, 3vw, 30px);
  transform: rotate(-1deg);
  margin: 0 0 -4px;
  display: inline-block;
}

.section-title {
  margin: 0 0 32px;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  font-family: var(--font-mono);
}

section { max-width: var(--max-width); margin: 0 auto; padding: clamp(48px, 6vw, 72px) clamp(24px, 5vw, 72px); }

/* ---------- grain overlay ---------- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  filter: url(#grain);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(24px, 5vw, 72px);
  background: color-mix(in oklch, var(--paper) 85%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1.5px dashed color-mix(in oklch, var(--ink) 25%, transparent);
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
}
.logo span { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 4px; }

.nav-link {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 4px 4px 0 0;
  border: 1px solid color-mix(in oklch, var(--ink) 20%, transparent);
  border-bottom: none;
}
.nav-link:hover { background: var(--paper-alt); }
.nav-link.is-contact { border-color: var(--accent); color: var(--accent); font-weight: 700; }

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
}

/* ---------- buttons ---------- */
.key-btn {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  padding: 13px 22px;
  border-radius: 4px;
  display: inline-block;
  transition: transform .12s ease, box-shadow .12s ease;
}
.key-btn.fill { background: var(--ink); color: var(--paper); box-shadow: 0 4px 0 color-mix(in oklch, var(--ink) 70%, transparent); }
.key-btn.outline { background: var(--paper); border: 1.5px solid var(--ink); box-shadow: 0 4px 0 color-mix(in oklch, var(--ink) 70%, transparent); }
.key-btn:hover { transform: translateY(2px); box-shadow: 0 2px 0 color-mix(in oklch, var(--ink) 70%, transparent); }
.btn-row { display: flex; gap: 16px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(32px, 5vw, 60px);
  align-items: start;
  padding-top: clamp(56px, 9vw, 100px);
}

.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

.hero-name {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.role-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in oklch, var(--accent) 8%, transparent);
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  padding: 7px 16px;
  margin: 6px 0 4px;
}

.hero-copy p { margin: 8px 0 4px; font-size: 17px; line-height: 1.75; color: var(--ink-soft); max-width: 48ch; }
.hero-copy p.sub { font-size: 15px; color: var(--ink-muted); max-width: 44ch; }

.hero-visual { position: relative; padding-top: 12px; }

.polaroid {
  background: var(--paper-card);
  box-shadow: 0 12px 24px -14px color-mix(in oklch, var(--ink) 40%, transparent);
  position: relative;
}
.polaroid img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.polaroid .frame { padding: 14px 14px 46px; }
.polaroid .caption { font-family: var(--font-hand); position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 18px; color: var(--ink-soft); }
.polaroid .tape { position: absolute; top: -14px; left: 50%; transform: translateX(-50%) rotate(-3deg); width: 70px; height: 26px; background: color-mix(in oklch, oklch(88% 0.05 95) 80%, transparent); box-shadow: 0 2px 4px color-mix(in oklch, var(--ink) 15%, transparent); }

.hero-main-photo { width: 78%; margin-left: 12%; transform: rotate(4deg); }

.facts-card {
  position: absolute;
  left: -10px;
  bottom: 16px;
  width: 200px;
  background: var(--paper-alt);
  border: 1px solid color-mix(in oklch, var(--ink) 18%, transparent);
  border-radius: 3px;
  padding: 16px 18px;
  transform: rotate(-6deg);
}
.facts-card .paperclip { position: absolute; top: -16px; left: 16px; }
.facts-card .label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; color: var(--ink-muted); margin-bottom: 8px; }
.facts-card ul { list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: 12.5px; line-height: 2.1; color: var(--ink-soft); }

/* ---------- experience ---------- */
.experience-list { display: flex; flex-direction: column; gap: 22px; }
.exp-card {
  background: var(--paper-card);
  border: 1.5px solid color-mix(in oklch, var(--ink) 20%, transparent);
  border-radius: 6px;
  padding: 26px 28px;
}
.exp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1.5px dashed color-mix(in oklch, var(--ink) 22%, transparent);
}
.exp-role { font-family: var(--font-mono); font-weight: 700; font-size: 16px; }
.exp-company { font-family: var(--font-serif); font-style: italic; color: var(--ink-soft); font-size: 15px; margin-top: 2px; }
.exp-dates {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  border: 1.5px dashed var(--accent);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}
.exp-card ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.55; color: var(--ink-muted); }
.exp-card li::marker { color: var(--accent); }

/* ---------- skills: circuit schematic ---------- */
.skill-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 32px;
  border: 1.5px solid color-mix(in oklch, var(--ink) 20%, transparent);
  border-radius: 6px;
  padding: clamp(28px, 3vw, 40px) clamp(24px, 3vw, 36px);
  background-color: var(--paper-card);
  background-image:
    linear-gradient(color-mix(in oklch, var(--ink) 6%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklch, var(--ink) 6%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
}

.chip-label {
  position: relative;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in oklch, var(--accent) 8%, var(--paper-card));
  border: 1.5px solid var(--accent);
  border-radius: 3px;
  padding: 8px 16px;
  margin-bottom: 26px;
}
.chip-label::before, .chip-label::after {
  content: '';
  position: absolute;
  top: -6px;
  width: 6px;
  height: 6px;
  background: var(--accent);
}
.chip-label::before { left: 14px; }
.chip-label::after { right: 14px; }

.circuit-trace { position: relative; padding-left: 22px; display: flex; flex-direction: column; gap: 16px; }
.circuit-trace::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  bottom: 2px;
  width: 2px;
  background: color-mix(in oklch, var(--accent) 50%, transparent);
}
.trace-node { position: relative; display: flex; align-items: center; gap: 10px; }
.trace-node::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  width: 16px;
  height: 2px;
  background: color-mix(in oklch, var(--accent) 50%, transparent);
  transform: translateY(-1px);
}
.node-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper-card);
  border: 2px solid var(--accent);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.node-label { font-family: var(--font-mono); font-size: 14.5px; }

/* ---------- contest record ---------- */
.contest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.contest-card {
  background: var(--paper-card);
  border: 1.5px solid color-mix(in oklch, var(--ink) 20%, transparent);
  border-radius: 6px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s ease;
}
a.contest-card:hover { border-color: var(--accent); }
.contest-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.contest-name { font-family: var(--font-mono); font-weight: 700; font-size: 15px; line-height: 1.3; }
.contest-year { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); white-space: nowrap; margin-left: 8px; }
.contest-host { font-family: var(--font-serif); font-style: italic; color: var(--ink-soft); font-size: 13.5px; }
.contest-result {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in oklch, var(--accent) 10%, transparent);
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  padding: 5px 12px;
  margin: 4px 0 2px;
}
.contest-detail { font-size: 13.5px; line-height: 1.5; color: var(--ink-muted); margin: 0; }
.contest-link { font-family: var(--font-hand); color: var(--accent); font-size: 16px; margin-top: 2px; }

/* ---------- projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 28px; }

.index-card {
  position: relative;
  display: block;
  background: var(--paper-card);
  border: 1.5px solid color-mix(in oklch, var(--ink) 25%, transparent);
  border-radius: 3px;
  padding: 26px 20px 20px;
  box-shadow: 0 10px 22px -14px color-mix(in oklch, var(--ink) 40%, transparent);
  transition: transform .18s ease, box-shadow .18s ease;
}
.index-card:hover { transform: rotate(0deg) translateY(-4px) !important; box-shadow: 0 18px 30px -14px color-mix(in oklch, var(--ink) 45%, transparent); }
.index-card .pin { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); }
.index-card .file-no { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); margin-bottom: 10px; }
.index-card .title { font-family: var(--font-mono); font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.index-card .desc { font-size: 13.5px; line-height: 1.55; color: var(--ink-muted); min-height: 58px; }
.index-card .tags { font-family: var(--font-hand); font-size: 15px; color: var(--accent); margin-top: 6px; }

/* ---------- off duty ---------- */
.offduty-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
.travel-strip { display: flex; gap: 22px; flex-wrap: wrap; }
.travel-photo { width: 168px; padding: 10px 10px 34px; position: relative; }
.travel-photo .shot {
  width: 100%;
  aspect-ratio: 1;
  background: var(--paper-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.travel-photo .shot img { width: 100%; height: 100%; object-fit: cover; }
.travel-photo .shot span { font-family: var(--font-mono); font-size: 11px; color: var(--ink-muted); }
.travel-photo .caption { font-family: var(--font-hand); position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 15px; color: var(--ink-soft); }

.guitar-note {
  background: var(--paper-alt);
  border: 1.5px dashed color-mix(in oklch, var(--ink) 30%, transparent);
  border-radius: 4px;
  padding: 24px;
  transform: rotate(1.5deg);
}
.guitar-note svg { display: block; margin: 0 auto 14px; }
.guitar-note p { font-family: var(--font-hand); font-size: 19px; text-align: center; color: var(--ink-soft); line-height: 1.4; margin: 0; }

/* ---------- contact ---------- */
.contact-card {
  background: var(--paper-card);
  border: 1.5px solid color-mix(in oklch, var(--ink) 25%, transparent);
  border-radius: 6px;
  padding: clamp(32px, 6vw, 56px);
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 32px;
  align-items: center;
}
.contact-card h2 { margin: 0 0 18px; font-family: var(--font-mono); font-size: clamp(24px, 3.6vw, 36px); font-weight: 700; max-width: 16ch; }
.contact-details { font-size: 14.5px; line-height: 2.1; }
.contact-details a { color: var(--accent); font-weight: 600; }
.contact-stamp { justify-self: center; transform: rotate(6deg); }

/* ---------- footer ---------- */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px clamp(24px, 5vw, 72px) 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1.5px dashed color-mix(in oklch, var(--ink) 25%, transparent);
}
.site-footer .mono { font-size: 11.5px; color: var(--ink-muted); }
.back-to-top { font-family: var(--font-mono); font-size: 11px; color: var(--ink-muted); padding: 6px 10px; }
.back-to-top:hover { background: var(--paper-alt); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { margin-top: 40px; }
  .offduty-grid { grid-template-columns: 1fr; }
  .skill-board { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-card { grid-template-columns: 1fr; text-align: left; }
  .contact-stamp { justify-self: start; }
}

@media (max-width: 640px) {
  .site-nav { display: none; gap: 8px; }
  .site-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 24px;
    background: var(--paper);
    border: 1.5px solid color-mix(in oklch, var(--ink) 25%, transparent);
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 12px 24px -12px color-mix(in oklch, var(--ink) 40%, transparent);
  }
  .nav-toggle { display: block; }
  .project-grid { grid-template-columns: 1fr; }
  .hero-main-photo { width: 100%; margin-left: 0; }
  .facts-card { position: static; width: 100%; transform: rotate(-1deg); margin-top: 20px; }
}
