/* Biraj Paudel, about me. Concept A: taped sketch card. */

:root {
  --paper: #f1ebdf;
  --card: #fbf7ee;
  --ink: #1f1b17;
  --ink-soft: #4a443d;   /* body copy */
  --ink-muted: #5f5950;  /* small grey text, AA on paper */
  --graphite: #7d776e;   /* doodle strokes only, never text */
  --red: #d6452a;        /* the one accent: big type, lines, strokes */
  --red-text: #bd3a21;   /* same red, darkened so small text passes AA */
  --gold: #dea13a;
  --teal: #2d6d69;
  --sky: #8ab3cd;
  --rule: rgba(31, 27, 23, 0.22);

  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-body: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Courier Prime", "Courier New", monospace;
  --f-hand: "Patrick Hand", "Comic Sans MS", cursive;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --slow: 0.9s;
  --gutter: clamp(16px, 5vw, 64px);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Paper grain: one fixed layer of feTurbulence noise, never interactive. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: 14px;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1328px;
  margin: 0 auto;
  padding: 40px var(--gutter) 48px;
}

.red { color: var(--red); }

/* ---------- Shared type ---------- */

.label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink);
}
.label::before {
  content: "";
  flex: none;
  width: 22px;
  height: 1.5px;
  background: var(--red);
}

.display {
  font-family: var(--f-display);
  font-weight: 600;
  font-variation-settings: "opsz" 144, "SOFT" 0;
  letter-spacing: -0.04em;
  line-height: 0.86;
}

.section-title {
  font-family: var(--f-display);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  font-size: clamp(36px, 4.6vw + 12px, 58px);
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 14px 0 34px;
}

/* Links in the mono style with a red underline */
.link {
  display: inline-block;
  padding: 4px 0 2px;
  font-family: var(--f-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(var(--red), var(--red)) left bottom / 100% 1.5px no-repeat;
  transition: background-size 0.5s var(--ease), color 0.4s var(--ease);
}
.link:hover,
.link:focus-visible {
  color: var(--red-text);
  background-size: 100% 3px;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  text-decoration: none;
  padding: 8px 0;
}

.nav-list {
  display: flex;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.nav-list li + li::before {
  content: "·";
  padding: 0 0.6em;
}
.nav-list a {
  display: inline-block;
  padding: 10px 0;
  text-decoration: none;
  background: linear-gradient(var(--red), var(--red)) left 80% / 0 1.5px no-repeat;
  transition: background-size 0.5s var(--ease);
}
.nav-list a:hover,
.nav-list a:focus-visible { background-size: 100% 1.5px; }
.nav-hi { color: var(--red-text); }

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 70px 0 90px;
}

.hero .display {
  font-size: clamp(120px, 12.5vw, 184px);
  margin-top: 22px;
}

.tagline {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 2.2vw + 12px, 38px);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-top: 34px;
  max-width: 15ch;
}

.wob {
  position: relative;
  white-space: nowrap;
}
.wob-line {
  position: absolute;
  left: -4px;
  bottom: -10px;
  width: calc(100% + 10px);
  height: 14px;
  overflow: visible;
}
.wob-line path {
  stroke: var(--red);
  stroke-width: 3.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.motion .wob-line path {
  stroke-dashoffset: 1;
  animation: draw 1.4s var(--ease) 0.7s forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }

/* The taped index card */
.card {
  position: relative;
  background: var(--card);
  padding: 34px 30px 26px;
  transform: rotate(2.2deg);
  box-shadow:
    0 1px 1px rgba(31, 27, 23, 0.06),
    0 14px 30px -18px rgba(31, 27, 23, 0.45);
}

.tape {
  position: absolute;
  top: -14px;
  left: 40%;
  width: 96px;
  height: 30px;
  background: rgba(222, 161, 58, 0.55);
  transform: rotate(-2deg);
  /* torn ends */
  clip-path: polygon(0 6%, 4% 0, 8% 8%, 12% 0, 88% 0, 92% 8%, 96% 0, 100% 6%, 100% 94%, 96% 100%, 92% 92%, 88% 100%, 12% 100%, 8% 92%, 4% 100%, 0 94%);
  box-shadow: inset 0 0 0 1px rgba(222, 161, 58, 0.25);
}

/* Doodles start as graphite and take their colour on hover/focus */
.doodle path,
.doodle circle {
  stroke: var(--graphite);
  stroke-width: 2.2;
  transition: stroke var(--slow) var(--ease), fill var(--slow) var(--ease);
}
.doodle .d-red { fill: var(--graphite); }

.card:hover .d-red, .card:focus-within .d-red,
.email-row:hover .d-red, .email-row:focus-within .d-red { stroke: var(--red); fill: var(--red); }
.card:hover .d-gold, .card:focus-within .d-gold { stroke: var(--gold); }
.card:hover .d-sky, .card:focus-within .d-sky { stroke: var(--sky); }
.card:hover .d-teal, .card:focus-within .d-teal { stroke: var(--teal); }
.email-row:hover .d-ink, .email-row:focus-within .d-ink { stroke: var(--ink); }
.email-row .d-red { fill: none; }

.pencil { width: 100%; height: auto; }

.hand {
  font-family: var(--f-hand);
  font-size: 24px;
  line-height: 1.2;
  color: var(--teal);
  margin-top: 10px;
}

/* Doodle pad */
.pad {
  position: relative;
  margin-top: 26px;
  height: 128px;
  border: 1.5px dashed rgba(31, 27, 23, 0.35);
  border-radius: 4px;
}
.pad-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  border-radius: 4px;
}
.pad-note {
  position: absolute;
  right: 10px;
  bottom: 6px;
  font-family: var(--f-hand);
  font-size: 19px;
  color: var(--ink-muted);
  pointer-events: none;
  transition: opacity 0.6s var(--ease);
}
.pad.has-ink .pad-note { opacity: 0.45; }

.pad-erase {
  position: absolute;
  left: 4px;
  bottom: 2px;
  min-height: 36px;
  min-width: 44px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  font-family: var(--f-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: color 0.4s var(--ease);
}
.pad-erase:hover,
.pad-erase:focus-visible { color: var(--red-text); }

/* ---------- Sections ---------- */

.section { padding: 56px 0 72px; }

.about-text {
  margin-top: 22px;
  max-width: 34em;
  font-size: clamp(20px, 1vw + 15px, 25px);
  line-height: 1.5;
  color: var(--ink-soft);
}
.pencil-line {
  color: var(--ink);
  background: linear-gradient(var(--graphite), var(--graphite)) left 92% / 100% 1.5px no-repeat;
  transition: background-image var(--slow) var(--ease);
}
.about-text:hover .pencil-line {
  background-image: linear-gradient(var(--red), var(--red));
}

/* Numbered work list */
.rows { border-bottom: 1px solid var(--rule); }

.row {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding: 26px 0 28px;
  border-top: 1px solid var(--rule);
}

.num {
  position: relative;
  justify-self: start;
  padding-top: 10px;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--red-text);
}
/* a pencil ring drawn around the number on hover */
.ring {
  position: absolute;
  left: -14px;
  top: 0;
  width: 52px;
  height: 38px;
  overflow: visible;
  pointer-events: none;
}
.ring path {
  stroke: var(--graphite);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1s var(--ease), stroke 1s var(--ease);
}
.row:hover .ring path,
.row:focus-within .ring path {
  stroke: var(--red);
  stroke-dashoffset: 0;
}

.row h3 {
  font-family: var(--f-display);
  font-weight: 600;
  font-variation-settings: "opsz" 72;
  font-size: clamp(25px, 1vw + 18px, 31px);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.co {
  font-weight: 400;
  font-size: 0.66em;
  letter-spacing: -0.01em;
  color: #6d665d;
}
.row p {
  margin-top: 6px;
  max-width: 58ch;
  font-size: 16px;
  color: var(--ink-soft);
}

.meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding-top: 8px;
  text-align: right;
}
.years {
  font-family: var(--f-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* Experience */
.exp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 64px;
  align-items: start;
}

.exp-list { border-bottom: 1px solid var(--rule); }
.exp {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}
.exp-name {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(21px, 0.8vw + 16px, 26px);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.exp .co { font-size: 0.72em; }

.edu {
  margin-top: 22px;
  color: var(--ink-soft);
}
.edu-label {
  margin-right: 10px;
  font-family: var(--f-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink);
}

/* Pinned note */
.note {
  position: relative;
  background: var(--card);
  padding: 34px 28px 30px;
  transform: rotate(-1.6deg);
  box-shadow:
    0 1px 1px rgba(31, 27, 23, 0.06),
    0 14px 30px -18px rgba(31, 27, 23, 0.45);
}
.pin {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ef7a62, var(--red) 60%, #a33320);
  box-shadow: 2px 3px 3px rgba(31, 27, 23, 0.3);
}
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 16px;
  font-family: var(--f-hand);
  font-size: 23px;
  line-height: 1.35;
}

/* Contact */
.contact { padding-bottom: 96px; }

.contact-title {
  font-family: var(--f-display);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
  font-size: clamp(48px, 7vw + 16px, 112px);
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin: 16px 0 36px;
}

.email-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
.arrow {
  width: 72px;
  height: auto;
  flex: none;
}

.email {
  font-family: var(--f-display);
  font-style: italic;
  font-size: clamp(22px, 2vw + 14px, 40px);
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--red), var(--red)) left 96% / 100% 2px no-repeat;
  transition: background-size 0.5s var(--ease), color 0.4s var(--ease);
}
.email:hover,
.email:focus-visible { color: var(--red-text); background-size: 100% 4px; }

.copy {
  min-height: 44px;
  min-width: 88px;
  padding: 8px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  font-family: var(--f-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.copy:hover { background: var(--ink); color: var(--paper); }
.copy.is-copied { border-color: var(--teal); background: var(--teal); color: var(--card); }

.copy-status {
  font-family: var(--f-hand);
  font-size: 20px;
  color: var(--teal);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin-top: 40px;
}
.socials .link { padding: 10px 0 4px; }

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--f-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
}
.site-footer a {
  padding: 8px 0;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 4px;
}

main:focus { outline: none; }

/* ---------- Motion: gentle fade and rise on scroll ---------- */

.motion .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.motion .reveal.is-in { opacity: 1; transform: none; }
/* the card keeps its tilt while it rises */
.motion .card.reveal { transform: translateY(16px) rotate(2.2deg); }
.motion .card.reveal.is-in { transform: rotate(2.2deg); }
.motion .note.reveal { transform: translateY(16px) rotate(-1.6deg); }
.motion .note.reveal.is-in { transform: rotate(-1.6deg); }

/* ---------- Layout breakpoints ---------- */

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 48px 0 64px;
  }
  .hero .display { font-size: clamp(84px, 22vw + 6px, 160px); }
  .card {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
  }
  .exp-grid { grid-template-columns: 1fr; gap: 48px; }
  .note { max-width: 420px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding-top: 20px; }
  .nav-extra { display: none; }
  .nav-list li + li::before { content: none; }
  .nav-hi { padding: 12px 0; }

  .hero { padding-top: 36px; }
  .card { padding: 30px 20px 22px; transform: rotate(1.4deg); }
  .motion .card.reveal { transform: translateY(16px) rotate(1.4deg); }
  .motion .card.reveal.is-in { transform: rotate(1.4deg); }

  .section { padding: 40px 0 56px; }
  .section-title { margin-bottom: 24px; }

  /* the right-hand column stacks under the text */
  .row {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 4px 14px;
    padding: 22px 0 22px;
  }
  .num { padding-top: 8px; }
  .ring { left: -10px; width: 44px; }
  .meta {
    grid-column: 2;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 18px;
    padding-top: 10px;
    text-align: left;
  }
  .meta .link { padding: 10px 0 4px; }

  .exp { flex-direction: column; gap: 2px; }
  .arrow { display: none; }
  .email-row { gap: 12px 14px; }
}

/* ---------- Print: never leave content hidden ---------- */

@media print {
  body::before, .pad, .skip-link { display: none; }
  .motion .reveal { opacity: 1; transform: none; }
}

/* ---------- Reduced motion: everything holds still ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
  .wob-line path { stroke-dashoffset: 0 !important; }
}
