/* =============================================================
   Rachit Ratnam Mudaliar: portfolio styles
   Midnight black, electric blue, cantaloupe orange.
   Self-hosted fonts (SIL Open Font License). No outside requests.
   ============================================================= */

@font-face { font-family: "Inter Display"; src: url("/assets/fonts/inter-display-500.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("/assets/fonts/inter-display-600.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/assets/fonts/lora-var.woff") format("woff"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/assets/fonts/lora-italic-var.woff") format("woff"); font-weight: 400 700; font-style: italic; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --black: #02070a;
  --blue: #0297de;
  --blue-soft: #5cc3f2;
  --orange: #fc734d;
  --orange-soft: #ffb08f;

  --bg: #02070a;
  --surface: #0a1318;
  --surface-2: #0f1b22;
  --ink: #eef4f7;
  --muted: #9bacb6;
  --rule: rgba(255, 255, 255, .1);
  --link: #5cc3f2;
  --glass: rgba(255, 255, 255, .06);
  --shadow: 0 30px 70px -30px rgba(0, 0, 0, .9);
  --glow: radial-gradient(60% 80% at 100% 0%, rgba(2, 151, 222, .16), transparent 70%);

  --sans: "Inter Display", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Lora", ui-serif, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(1.1rem, 5vw, 3rem);
  --max: 72rem;
  --radius: 22px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f2ef;
  --surface: #ffffff;
  --surface-2: #faf8f6;
  --ink: #0b1216;
  --muted: #4d5d67;
  --rule: #e0dad3;
  --link: #02669a;
  --glass: rgba(2, 7, 10, .04);
  --shadow: 0 24px 60px -30px rgba(2, 30, 50, .35);
  --glow: radial-gradient(60% 80% at 100% 0%, rgba(2, 151, 222, .12), transparent 70%);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5.5rem; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-weight: 500; font-size: 1.0625rem; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.12; }
p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { list-style: none; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue-soft); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 90; padding: .6rem 1rem; background: #fff; color: #000; border-radius: 8px; }
.skip:focus { top: 1rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
em { font-style: italic; }

/* ---------- Type ---------- */
.eyebrow { font-family: var(--mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); margin-bottom: .9rem; }
.title { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.025em; }
.title em { color: var(--blue-soft); }
:root[data-theme="light"] .title em { color: var(--link); }
.lead { margin-top: 1rem; color: var(--muted); max-width: 40rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2; padding: .8rem 1.35rem; border-radius: 999px; border: 1px solid transparent; text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn--solid { background: #fff; color: #02070a; box-shadow: 0 12px 34px -12px rgba(2, 151, 222, .85); }
.btn--solid:hover { background: var(--blue-soft); }
.btn--ghost { background: var(--glass); color: var(--ink); border-color: rgba(255, 255, 255, .28); }
.btn--ghost:hover { background: rgba(255, 255, 255, .14); }
:root[data-theme="light"] .btn--solid { background: #02070a; color: #fff; }
:root[data-theme="light"] .btn--solid:hover { background: var(--blue); }
:root[data-theme="light"] .btn--ghost { border-color: rgba(2, 7, 10, .25); }
:root[data-theme="light"] .btn--ghost:hover { background: rgba(2, 7, 10, .08); }
.hero .btn--solid:hover, .contact .btn--solid:hover { color: #02070a; }
.hero .btn--ghost, .contact .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
:root[data-theme="light"] .hero .btn--solid, :root[data-theme="light"] .contact .btn--solid { background: #fff; color: #02070a; }

/* ---------- Header ---------- */
.top { position: fixed; inset: .75rem 0 auto 0; z-index: 80; pointer-events: none; }
.top__in { pointer-events: auto; max-width: var(--max); margin: 0 auto; width: calc(100% - 2 * var(--gutter) + 1rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .45rem .55rem .45rem 1rem; border-radius: 999px; background: rgba(2, 7, 10, .62); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); color: #fff; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; color: #fff; text-decoration: none; letter-spacing: -.01em; }
.brand__mark { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 8px; background: #fff; color: #02070a; font-size: .78rem; font-weight: 600; }
.nav { display: flex; align-items: center; gap: .25rem; font-size: .92rem; }
.nav a:not(.btn) { color: rgba(255, 255, 255, .78); text-decoration: none; padding: .4rem .75rem; border-radius: 999px; }
.nav a:not(.btn):hover { color: #fff; background: rgba(255, 255, 255, .1); }
.theme { font: inherit; font-size: .82rem; color: rgba(255, 255, 255, .8); background: none; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: .3rem .8rem; margin: 0 .35rem; cursor: pointer; }
.theme:hover { color: #fff; border-color: #fff; }
.nav .btn { padding: .5rem 1.05rem; font-size: .9rem; background: #fff; color: #02070a; box-shadow: none; }
.nav .btn:hover { background: var(--blue-soft); }
@media (max-width: 56rem) { .nav a.opt { display: none; } }
@media (max-width: 34rem) { .nav a:not(.btn):not(.opt) { display: none; } .brand__name { display: none; } }

/* ---------- Hero: the light beam ---------- */
.hero, .contact {
  position: relative; isolation: isolate; overflow: hidden; color: #fff;
  background:
    radial-gradient(75% 38% at 50% 100%, rgba(252, 115, 77, .9), rgba(252, 115, 77, .4) 45%, transparent 75%),
    radial-gradient(24% 78% at 50% 42%, rgba(120, 210, 255, .8), rgba(2, 151, 222, .5) 35%, transparent 75%),
    radial-gradient(60% 70% at 50% 50%, rgba(2, 151, 222, .42), transparent 75%),
    #02070a;
}
.hero { padding: clamp(7rem, 14vw, 9.5rem) 0 clamp(3rem, 7vw, 5rem); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,.09) 1px, rgba(255,255,255,0) 3px, rgba(255,255,255,0) 7px);
  -webkit-mask-image: radial-gradient(55% 80% at 50% 45%, #000 20%, transparent 85%); mask-image: radial-gradient(55% 80% at 50% 45%, #000 20%, transparent 85%);
  mix-blend-mode: screen; opacity: .9; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14%; z-index: -1; pointer-events: none; background: linear-gradient(180deg, transparent, var(--bg)); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.pill { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--mono); font-size: .8rem; padding: .35rem .85rem; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2); color: rgba(255, 255, 255, .9); margin-bottom: 1.4rem; }
.pill::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: #3be28b; box-shadow: 0 0 0 4px rgba(59, 226, 139, .2); }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 7.4vw, 5.6rem); line-height: 1.02; letter-spacing: -.03em; text-shadow: 0 6px 40px rgba(0, 0, 0, .35); }
.hero h1 em { color: var(--blue-soft); }
.tags { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin-top: 1.25rem; font-family: var(--mono); font-size: .82rem; color: rgba(255, 255, 255, .78); }
.tags li::before { content: "\2022\00a0"; color: var(--orange); }
.hero__lead { margin-top: 1.25rem; max-width: 36rem; color: rgba(255, 255, 255, .86); font-size: clamp(1.02rem, 1.7vw, 1.2rem); }
.hero__lead + .hero__lead { margin-top: .6rem; color: rgba(255, 255, 255, .7); font-size: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.9rem; }
.portrait { position: relative; justify-self: end; width: min(100%, 21rem); }
.portrait::before { content: ""; position: absolute; inset: -1.1rem; border-radius: 34px; background: radial-gradient(60% 60% at 50% 40%, rgba(2, 151, 222, .55), transparent 70%); filter: blur(24px); z-index: -1; }
.portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 26px; border: 1px solid rgba(255, 255, 255, .35); box-shadow: 0 30px 70px -26px rgba(0, 0, 0, .8); }
.portrait__tag { position: absolute; left: -.9rem; bottom: 1.3rem; font-family: var(--mono); font-size: .78rem; padding: .45rem .8rem; border-radius: 12px; background: rgba(2, 7, 10, .72); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; }
@media (max-width: 52rem) { .hero__grid { grid-template-columns: minmax(0, 1fr); } .portrait { order: -1; justify-self: start; width: 8.5rem; } .portrait__tag { display: none; } }

/* phones on the glow */
.phones { display: flex; justify-content: center; align-items: flex-end; gap: clamp(.6rem, 2.5vw, 1.6rem); margin-top: clamp(2.5rem, 6vw, 4rem); }
.phones a { display: block; flex: 0 1 clamp(6.5rem, 19vw, 13.5rem); transition: transform .3s ease; }
.phones a:nth-child(1) { transform: rotate(-4deg) translateY(1rem); }
.phones a:nth-child(2) { transform: translateY(-.8rem) scale(1.07); z-index: 2; }
.phones a:nth-child(3) { transform: rotate(4deg) translateY(1rem); }
.phones a:hover { transform: translateY(-.4rem) scale(1.03); }
.phones img, .shots img { width: 100%; aspect-ratio: 9 / 20; object-fit: cover; border-radius: clamp(14px, 2.2vw, 28px); border: 1px solid rgba(255, 255, 255, .28); box-shadow: 0 30px 60px -22px rgba(0, 0, 0, .85); background: #0a1318; }
.phones__cap { text-align: center; margin-top: 2rem; font-family: var(--mono); font-size: .78rem; color: rgba(255, 255, 255, .7); letter-spacing: .04em; }

/* ---------- Sections ---------- */
.sec { padding: clamp(3rem, 8vw, 5.5rem) 0; }
.card { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); box-shadow: var(--shadow); }
.card--glow { background: var(--glow), var(--surface); }
.bento { margin-top: 2rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 52rem) { .bento { grid-template-columns: minmax(0, 1fr); } }
.card h3 { font-size: 1.3rem; }
.card h3 + p, .card .when { margin-top: .35rem; }
.when { color: var(--muted); font-family: var(--mono); font-size: .82rem; }
.card p { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.1rem; }
.chips li { font-size: .86rem; border: 1px solid var(--rule); border-radius: 999px; padding: .2rem .8rem; background: var(--glass); color: var(--ink); }
.skills { display: grid; gap: .9rem; margin-top: 1.1rem; font-size: .96rem; }
.skills div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .75rem; }
.skills dt { font-family: var(--mono); font-size: .8rem; color: var(--orange); padding-top: .15rem; }

/* experience */
.tl { margin-top: 2rem; position: relative; display: grid; gap: 1.25rem; padding-left: 1.75rem; }
.tl::before { content: ""; position: absolute; left: .45rem; top: .6rem; bottom: .6rem; width: 2px; background: linear-gradient(180deg, var(--blue), var(--orange)); border-radius: 2px; opacity: .8; }
.tl .card::before { content: ""; position: absolute; left: -1.75rem; top: 1.7rem; width: .95rem; height: .95rem; border-radius: 50%; background: var(--bg); border: 3px solid var(--orange); box-shadow: 0 0 0 5px rgba(252, 115, 77, .15); }
.tl .when { margin-bottom: .6rem; }
.badge { display: inline-block; font-family: var(--mono); font-size: .72rem; padding: .1rem .6rem; border-radius: 999px; border: 1px solid var(--rule); color: var(--muted); margin-left: .6rem; vertical-align: middle; font-weight: 500; }
.points { margin-top: 1rem; display: grid; gap: .6rem; font-size: .98rem; color: var(--muted); }
.points li { position: relative; padding-left: 1.2rem; }
.points li::before { content: ""; position: absolute; left: 0; top: .7em; width: .5rem; height: 2px; background: var(--orange); border-radius: 2px; }

/* services */
.services { margin-top: 2rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.service__n { font-family: var(--mono); font-size: .8rem; color: var(--orange); margin-bottom: .8rem; }
.steps { margin-top: 1.25rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; counter-reset: s; }
.steps li { counter-increment: s; border-top: 2px solid var(--rule); padding-top: .9rem; font-size: .95rem; color: var(--muted); }
.steps li::before { content: "0" counter(s); display: block; font-family: var(--mono); font-size: .78rem; color: var(--blue-soft); margin-bottom: .25rem; }
.steps strong { display: block; color: var(--ink); font-weight: 600; }
@media (max-width: 52rem) { .services { grid-template-columns: minmax(0, 1fr); } .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* proof of work */
.work { margin-top: 2.25rem; display: grid; gap: 1.5rem; }
.case { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; overflow: hidden; }
.case__tag { color: var(--blue-soft); font-family: var(--mono); font-size: .82rem; margin-top: .4rem; }
:root[data-theme="light"] .case__tag { color: var(--link); }
.case h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 3.6vw, 2.5rem); letter-spacing: -.02em; }
.facts { margin-top: 1.1rem; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .4rem 1.1rem; font-size: .93rem; }
.facts dt { color: var(--muted); font-family: var(--mono); font-size: .8rem; padding-top: .1rem; }
.facts dd { color: var(--ink); }
.links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.links .btn { padding: .6rem 1.1rem; font-size: .9rem; }
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.5rem, 1.6vw, 1rem); align-items: center; }
.shots img { border-color: var(--rule); }
.shots img:nth-child(2) { transform: translateY(-.9rem); }
.shots a { display: contents; }
@media (max-width: 52rem) { .case { grid-template-columns: minmax(0, 1fr); } .shots { order: -1; max-width: 32rem; } }

/* github band */
.band { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.band p { max-width: 34rem; }
.band .btn { max-width: 100%; overflow-wrap: anywhere; text-align: center; font-family: var(--mono); font-size: .9rem; }

/* contact */
.contact { padding: clamp(4rem, 10vw, 7rem) 0; text-align: center; background:
    radial-gradient(75% 45% at 50% 108%, rgba(252, 115, 77, .85), rgba(252, 115, 77, .35) 45%, transparent 75%),
    radial-gradient(40% 70% at 50% 20%, rgba(2, 151, 222, .55), transparent 75%),
    #02070a; }
.contact .eyebrow { color: var(--orange-soft); }
.contact .title { font-size: clamp(2.2rem, 6vw, 4rem); text-shadow: 0 6px 40px rgba(0, 0, 0, .35); }
.contact .title em { color: var(--blue-soft); }
.contact .lead { margin-left: auto; margin-right: auto; color: rgba(255, 255, 255, .8); }
.mailrow { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .6rem; margin-top: 1.75rem; padding: .5rem .5rem .5rem 1.4rem; border-radius: 999px; background: rgba(2, 7, 10, .55); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); max-width: 100%; }
.mail { font-family: var(--mono); font-size: clamp(.95rem, 3.2vw, 1.25rem); color: #fff; text-decoration: none; overflow-wrap: anywhere; }
.mailrow .btn { padding: .55rem 1.1rem; }
#copyStatus { font-size: .82rem; color: rgba(255, 255, 255, .8); min-width: 4.5rem; text-align: left; }
.contact .actions { justify-content: center; }

/* full story */
.story { margin-top: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.story h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 3.6vw, 2.2rem); letter-spacing: -.02em; }
.story p { margin-top: .4rem; max-width: 32rem; }

/* footer */
.foot { border-top: 1px solid var(--rule); padding: 1.75rem 0 2.5rem; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }

/* 404 */
.nf { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 3rem 0; }
.nf h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 7vw, 4rem); }
.nf p { margin-top: 1rem; color: var(--muted); }
.nf .actions { justify-content: center; }

/* ---------- Motion ---------- */
@keyframes beam { 0%, 100% { opacity: 1; } 50% { opacity: .82; } }
.hero { animation: beam 9s ease-in-out infinite; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .phones a { transition: none; }
}

/* ---------- Screen sizes ---------- */
@media (max-width: 22rem) {
  body { font-size: 1rem; }
  .wrap { padding: 0 .9rem; }
  .top__in { padding: .3rem .4rem .3rem .8rem; }
  .brand { display: none; }
  .top__in { justify-content: center; }
  .theme { display: none; }
  .hero h1 { font-size: 2rem; }
  .actions .btn { width: 100%; }
  .phones a { flex-basis: 30%; }
  .phones a:nth-child(3) { display: none; }
  .skills div, .facts { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .facts dd { margin-bottom: .5rem; }
  .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shots a:nth-child(3) { display: none; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .mailrow { padding-left: .8rem; }
}
@media (hover: none) and (pointer: coarse) { .btn, .theme, .nav a { min-height: 2.75rem; } .nav a:not(.btn) { display: inline-flex; align-items: center; } }
@media (min-width: 1600px) { html { font-size: 20px; } }
@media (min-width: 2400px) { html { font-size: 28px; } :root { --max: 76rem; } }
@media (min-width: 3200px) { html { font-size: 36px; } }
:focus-visible { outline-width: 4px; }
@media (forced-colors: active) { .btn, .card, .chips li, .pill, .mailrow { border: 1px solid CanvasText; } }
@media print {
  .top, .theme, .skip, .phones, .hero::before, .hero::after { display: none; }
  .hero, .contact { background: #fff; color: #000; padding: 1rem 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card { box-shadow: none; border-color: #ccc; background: #fff; }
  a { color: #000; }
}
