/* ananyaiyer.site — the paper system
   Three primitives: the pink field, the cream sheet, the cutout.
   Everything else on the site is built from these. */

/* ---------------------------------------------------------------- tokens */

:root {
  --paper: #f5efdf;
  --paper-edge: #ede4d0;
  --pink: #ff2d8f;
  --pink-deep: #d6006e;
  --ink: #141414;
  --ink-soft: #5a554b;

  --serif-display: "Playfair Display", "Iowan Old Style", "Palatino Linotype",
    Palatino, Georgia, serif;
  --serif-text: "Newsreader", "Iowan Old Style", Charter, Georgia, serif;
  --sans-label: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;

  --sheet-margin: 4vw;
  --measure: 68ch;

  --sheet-shadow: 0 1px 2px rgba(60, 40, 20, 0.1),
    0 8px 24px rgba(60, 40, 20, 0.07);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ------------------------------------------------------------- the field */

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

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

body {
  margin: 0;
  background: var(--pink);
  color: var(--ink);
  font-family: var(--serif-text);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
}

/* ------------------------------------------------------------- the sheet */

.sheet {
  position: relative;
  background: var(--paper);
  border-radius: 2px;
  box-shadow: var(--sheet-shadow);
  margin: var(--sheet-margin);
  isolation: isolate;
}

/* Paper texture: a tiled noise layer plus a very faint warm gradient.
   Invisible until looked for. If it reads as texture it is too strong. */
.sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background-image: url("/static/img/paper-noise.svg"),
    radial-gradient(
      120% 90% at 30% 12%,
      rgba(255, 250, 235, 0.55) 0%,
      rgba(245, 239, 223, 0) 60%
    );
  background-size: 180px 180px, 100% 100%;
  opacity: 0.9;
}

.sheet--home {
  min-height: calc(100vh - (var(--sheet-margin) * 2));
  min-height: calc(100dvh - (var(--sheet-margin) * 2));
  display: grid;
  place-items: center;
  padding: 8vh 6vw;
}

.sheet--page {
  padding: clamp(2.5rem, 7vw, 6rem) clamp(1.5rem, 8vw, 7rem);
  min-height: calc(100vh - (var(--sheet-margin) * 2));
  min-height: calc(100dvh - (var(--sheet-margin) * 2));
}

/* The short sheets — contact, 404. Only a few lines, so they sit centred in
   the field the way the homepage does, rather than pinned to the top of a
   tall sheet where they read as unfinished. Text inside stays left-aligned. */
.sheet--centred {
  display: grid;
  place-items: center;
}

.sheet--centred > * {
  width: 100%;
  max-width: 32rem;
}

/* ------------------------------------------------------------ the cutout */

/* An opening in the cream where the pink underneath shows through.
   Inset shadow is what makes it read as below the paper, not printed on it. */
/* Organic, but a cut opening rather than an oval: the corner radii are in px
   and irregular, so the shape follows the words instead of ballooning into an
   ellipse the way percentage radii do on a short, wide element. */
.cut {
  --cut-radius: 15px 20px 16px 19px / 18px 15px 20px 16px;
  display: inline-block;
  background: var(--pink);
  color: var(--paper);
  border-radius: var(--cut-radius);
  /* Its own tight line-height: without this the cutout inherits the loose
     line-height of the lines and the opening balloons to the full line box. */
  line-height: 1.12;
  padding: 0.16em 0.32em 0.2em;
  margin: 0 0.03em;
  text-decoration: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease),
    background-color 180ms var(--ease);
  will-change: transform;
}

.cut:hover,
.cut:focus-visible {
  transform: translateY(-1px);
  background: #ff3f99;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.22),
    0 2px 5px rgba(60, 40, 20, 0.12);
}

.cut:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 3px;
}

/* Each instance gets a slightly different shape so no two cutouts match. */
.cut--a { --cut-radius: 16px 21px 15px 20px / 19px 15px 21px 17px; }
.cut--b { --cut-radius: 20px 15px 19px 17px / 15px 20px 16px 21px; }
.cut--c { --cut-radius: 17px 19px 21px 15px / 20px 17px 15px 19px; }

/* ---------------------------------------------------------------- home */

.home-lines {
  margin: 0;
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: clamp(1.75rem, 5.4vw, 2.75rem);
  /* Loose enough that the three cutouts never touch. */
  line-height: 2.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  text-align: left;
}

.home-lines p,
.home-lines h1 {
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
}

/* --------------------------------------------------------- typography */

h1,
h2,
h3 {
  font-family: var(--serif-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--ink);
}

.page-title {
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  line-height: 1.12;
  margin: 0 0 0.35em;
}

.label {
  font-family: var(--sans-label);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.5;
}

a {
  color: var(--ink);
  text-decoration-color: rgba(214, 0, 110, 0.45);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-color: var(--pink-deep);
}

a:focus-visible {
  outline: 2px solid var(--pink-deep);
  outline-offset: 2px;
  border-radius: 1px;
}

/* --------------------------------------------------------------- about */

.about-head {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.passport {
  flex: 0 0 auto;
  width: 120px;
  height: 150px;
  object-fit: cover;
  background: var(--paper-edge);
  border: 4px solid #fbf7ec;
  box-shadow: var(--sheet-shadow);
  border-radius: 1px;
}

.passport--empty {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.5rem;
  color: var(--ink-soft);
  font-family: var(--sans-label);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.prose {
  max-width: var(--measure);
}

.prose p {
  margin: 0 0 1.35em;
}

.prose h2 {
  font-size: 1.45rem;
  line-height: 1.25;
  margin: 2.4em 0 0.7em;
}

/* ------------------------------------------------------------ research */

/* Tabs protrude upward into the pink field so they read as physical tabs
   attached to the folder, not as a menu. Rotation and protrusion come from
   fixed per-category values so they never shift between loads. */
.folder {
  margin: var(--sheet-margin);
  margin-top: calc(var(--sheet-margin) + 30px);
  position: relative;
}

.tabs {
  position: absolute;
  top: 0;
  left: clamp(1rem, 4vw, 3.5rem);
  right: 0;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 2;
}

.tab {
  display: block;
  background: var(--paper-edge);
  color: var(--ink-soft);
  font-family: var(--sans-label);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 9px 14px 16px;
  border-radius: 3px 3px 0 0;
  box-shadow: 0 -1px 2px rgba(60, 40, 20, 0.09);
  transform-origin: bottom center;
  transition: transform 180ms var(--ease), background-color 180ms var(--ease),
    color 180ms var(--ease);
  white-space: nowrap;
}

.tab:hover {
  background: #f2ead6;
  color: var(--ink);
}

.tab[aria-current="page"] {
  background: var(--paper);
  color: var(--ink);
  z-index: 3;
}

.tab:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

.folder .sheet {
  margin: 0;
  position: relative;
  z-index: 1;
}

.tab-row {
  position: relative;
  height: 30px;
}

/* Subcategory list — layer two. A short list in the label sans, not tabs,
   not cards. */
.subcats {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.4rem;
}

.subcats a {
  font-family: var(--sans-label);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.subcats a:hover,
.subcats a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--pink);
}

/* Layer three — the listing */
.group {
  margin: 0 0 3.25rem;
  max-width: 78ch;
}

.group-head {
  font-family: var(--sans-label);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 0.6rem;
  margin: 0 0 1.5rem;
  border-bottom: 1px solid rgba(90, 85, 75, 0.22);
  font-weight: 500;
}

.entry {
  margin: 0 0 1.85rem;
  padding: 0;
}

.entry-title {
  font-family: var(--serif-display);
  font-size: clamp(1.12rem, 2.1vw, 1.4rem);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.015em;
  margin: 0 0 0.3rem;
}

.entry-title a {
  text-decoration: none;
  background-image: linear-gradient(var(--pink), var(--pink));
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 0 100%;
  transition: background-size 200ms var(--ease);
  padding-bottom: 2px;
}

.entry-title a:hover {
  background-size: 100% 1px;
}

.entry-meta {
  margin: 0 0 0.45rem;
}

.entry-intro {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 62ch;
}

/* ------------------------------------------------------------- article */

.article {
  max-width: var(--measure);
  margin: 0 auto;
}

.article-head {
  margin-bottom: 2.75rem;
}

.article-meta {
  margin: 0 0 1.75rem;
}

.article-meta a {
  color: var(--ink-soft);
  text-decoration-color: rgba(90, 85, 75, 0.35);
}

.article-meta a:hover {
  color: var(--ink);
  text-decoration-color: var(--pink-deep);
}

.article-intro {
  font-size: 1.16rem;
  line-height: 1.6;
  font-style: italic;
  color: var(--ink);
  margin: 0;
}

.article-body > p {
  margin: 0 0 1.35em;
}

.article-body h2 {
  font-size: 1.4rem;
  margin: 2.5em 0 0.7em;
}

.article-body ul {
  margin: 0 0 1.35em;
  padding-left: 1.15em;
}

.article-body li {
  margin-bottom: 0.5em;
}

/* Pull blocks — the forward call and the falsifier. Ordinary paragraphs in
   the markup, visually set apart in the flow. */
.pull {
  margin: 2em 0;
  padding: 0 0 0 1.4rem;
  border-left: 2px solid var(--pink);
}

.pull-label {
  display: block;
  font-family: var(--sans-label);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pink-deep);
  margin-bottom: 0.45rem;
}

.pull p {
  margin: 0;
}

/* A dated addendum. Sits on the pink-tinted paper so it reads as added to the
   sheet later, rather than as part of the original document. */
.update {
  margin: 2.75rem 0 0;
  padding: 1.35rem 1.5rem;
  background: rgba(255, 45, 143, 0.055);
  border-top: 2px solid var(--pink);
  border-radius: 0 0 2px 2px;
}

.update p {
  margin: 0;
}

.article-foot {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(90, 85, 75, 0.22);
}

.article-foot h2 {
  font-family: var(--sans-label);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.9rem;
}

.article-foot section + section {
  margin-top: 2.25rem;
}

.source-list,
.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.source-list li,
.related-list li {
  margin-bottom: 0.55rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Only primary and archived sources are marked. Press write-ups are the
   unmarked default, so the company's own pages stand out at a glance. */
.source-type {
  display: inline-block;
  margin-left: 0.5rem;
  font-family: var(--sans-label);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink-deep);
  border: 1px solid rgba(214, 0, 110, 0.35);
  border-radius: 2px;
  padding: 1px 5px;
  vertical-align: 1.5px;
  white-space: nowrap;
}

.pending {
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-style: italic;
  margin: 0;
}

/* ------------------------------------------------------------- contact */

.contact-lines {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  font-size: 1.1rem;
}

.contact-lines li {
  margin-bottom: 0.9rem;
}

/* ---------------------------------------------------------- back link */

.back {
  display: inline-block;
  margin-top: 3rem;
  font-family: var(--sans-label);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.back:hover {
  color: var(--ink);
  border-bottom-color: var(--pink);
}

.article-foot .back {
  margin-top: 2.25rem;
}

/* ---------------------------------------------------------------- misc */

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

/* ------------------------------------------------------------- mobile */

@media (max-width: 720px) {
  :root {
    --sheet-margin: 3vw;
  }

  body {
    font-size: 17px;
  }

  .sheet--home {
    padding: 6vh 7vw;
  }

  .home-lines {
    line-height: 1.9;
  }

  .about-head {
    flex-direction: column;
    gap: 1.25rem;
  }

  /* Tabs stay physical on mobile — a scrollable row along the top edge,
     never a dropdown or a hamburger. */
  .tabs {
    left: 0;
    right: 0;
    padding: 0 3vw;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    font-size: 10px;
    padding: 8px 11px 15px;
    letter-spacing: 0.1em;
  }
}

/* --------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ------------------------------------------------- page transitions */

/* One transition everywhere: a sheet taken off the desk, another placed
   down. View Transitions API only — no JavaScript shim fallback. */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: sheet-out 160ms var(--ease) both;
}

::view-transition-new(root) {
  animation: sheet-in 200ms var(--ease) both;
}

@keyframes sheet-out {
  to {
    opacity: 0;
    transform: translate(12px, 12px);
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* -------------------------------------------------------------- print */

@media print {
  body {
    background: #fff;
  }
  .sheet {
    margin: 0;
    box-shadow: none;
  }
  .sheet::before {
    display: none;
  }
  .tabs,
  .back {
    display: none;
  }
}
