/* === Sphoorti Metri — Portfolio === */

:root {
  --accent: #2563eb;
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);
  --accent-line: color-mix(in oklab, var(--accent) 30%, transparent);

  --bg: #f3f4f7;
  --bg-elev: #ffffff;
  --ink: #0b0f1a;
  --ink-2: #1a2030;
  --mute: #5a6478;
  --mute-2: #8b94a7;
  --line: #d8dce4;
  --line-2: #e6e9ef;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --rad: 6px;

  --gutter: clamp(20px, 4vw, 48px);
  --max: 1240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
}

::selection { background: var(--accent); color: #fff; }

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

/* === Background grid (subtle) === */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in oklab, var(--ink) 4%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklab, var(--ink) 4%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, #000 50%, transparent 90%);
  z-index: 0;
}

/* === Layout === */
.shell {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section { padding: 96px 0; position: relative; }
section + section { border-top: 1px solid var(--line-2); }

@media (max-width: 720px) {
  section { padding: 64px 0; }
}

/* === Navigation === */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  background: color-mix(in oklab, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--line-2);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.nav-logo .mark {
  width: 22px; height: 22px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  background: var(--ink);
  color: var(--bg);
}
.nav-links {
  display: flex;
  gap: 28px;
  color: var(--mute);
}
.nav-links a {
  position: relative;
  transition: color .15s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav-links a:hover::before { transform: scaleX(1); }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* === Type === */
h1, h2, h3, h4 { font-family: var(--mono); font-weight: 600; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }

.kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.kicker::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--accent);
  display: inline-block;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 56px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--line);
}
.section-header h2 {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
}
.section-header h2 .num {
  color: var(--mute-2);
  margin-right: 12px;
  font-weight: 400;
}
.section-meta {
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.05em;
}

/* === Hero === */
.hero { padding-top: 80px; padding-bottom: 96px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 64px;
  align-items: end;
}
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: var(--ink-2);
  background: var(--bg-elev);
}
.status .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px color-mix(in oklab, #16a34a 22%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in oklab, #16a34a 22%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in oklab, #16a34a 8%, transparent); }
}

.terminal-prompt {
  margin-top: 28px;
  font-size: 12.5px;
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 10px;
}
.terminal-prompt .sigil { color: var(--accent); }
.terminal-prompt .cmd { color: var(--ink-2); }
.cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero h1 {
  font-size: clamp(40px, 6.4vw, 76px);
  line-height: 1.02;
  margin: 18px 0 18px;
  letter-spacing: -0.035em;
  font-weight: 600;
}
.hero h1 .accent { color: var(--accent); }
.hero-sub {
  font-size: clamp(15px, 1.5vw, 17px);
  color: var(--ink-2);
  max-width: 56ch;
  line-height: 1.55;
}
.hero-sub strong { color: var(--ink); font-weight: 600; }

.hero-meta {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: var(--bg-elev);
  overflow: hidden;
}
.hero-meta > div {
  padding: 14px 18px;
  border-right: 1px solid var(--line-2);
}
.hero-meta > div:last-child { border-right: 0; }
.hero-meta .label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mute);
}
.hero-meta .val {
  font-size: 14px;
  color: var(--ink);
  margin-top: 4px;
  font-weight: 500;
}
@media (max-width: 560px) {
  .hero-meta { grid-template-columns: 1fr; }
  .hero-meta > div { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .hero-meta > div:last-child { border-bottom: 0; }
}

/* === Photo card === */
.photo-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: var(--bg-elev);
  padding: 12px;
  width: 100%;
  max-width: 360px;
  margin-left: auto;
}
.photo-card .img-wrap {
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  background: var(--line-2);
  position: relative;
}
.photo-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.02);
}
.photo-card .corners::before,
.photo-card .corners::after,
.photo-card .corners > span::before,
.photo-card .corners > span::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border: 1px solid var(--accent);
}
.photo-card .corners::before { top: 4px; left: 4px; border-right: 0; border-bottom: 0; }
.photo-card .corners::after { top: 4px; right: 4px; border-left: 0; border-bottom: 0; }
.photo-card .corners > span::before { content: ""; bottom: 4px; left: 4px; border-right: 0; border-top: 0; }
.photo-card .corners > span::after { content: ""; bottom: 4px; right: 4px; border-left: 0; border-top: 0; }

.photo-meta {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--mute);
  padding: 0 4px;
  letter-spacing: 0.05em;
}
.photo-meta b { color: var(--ink); font-weight: 500; }

/* === About === */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
}
@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}
.about-text {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 60ch;
  text-wrap: pretty;
}
.about-text p + p { margin-top: 18px; }
.about-text .accent { color: var(--accent); }

.spec-sheet {
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: var(--bg-elev);
  font-size: 12.5px;
}
.spec-sheet .row {
  display: grid;
  grid-template-columns: 110px 1fr;
  border-bottom: 1px solid var(--line-2);
  padding: 12px 16px;
}
.spec-sheet .row:last-child { border-bottom: 0; }
.spec-sheet .row .k {
  color: var(--mute);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  padding-top: 1px;
}
.spec-sheet .row .v { color: var(--ink); }
.spec-sheet .row .v a:hover { color: var(--accent); }

/* === Experience timeline === */
.timeline { display: flex; flex-direction: column; gap: 0; }
.role {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px dashed var(--line);
  position: relative;
}
.role:first-child { border-top: 0; padding-top: 0; }
.role-time {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--mute);
  padding-top: 2px;
}
.role-time .span {
  display: block;
  font-variant-numeric: tabular-nums;
}
.role-time .duration {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 10px;
  background: var(--bg-elev);
}
.role-body h3 {
  font-size: 18px;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.role-body .company {
  color: var(--accent);
  font-weight: 500;
}
.role-body .where {
  font-size: 11.5px;
  color: var(--mute);
  margin-top: 2px;
  letter-spacing: 0.04em;
}
.role-body ul {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.role-body li {
  position: relative;
  padding-left: 22px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 76ch;
}
.role-body li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 720px) {
  .role { grid-template-columns: 1fr; gap: 12px; }
}

/* === Skills === */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--rad);
  overflow: hidden;
}
@media (max-width: 720px) {
  .skill-grid { grid-template-columns: 1fr; }
}
.skill-cell {
  background: var(--bg-elev);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 120px;
}
.skill-cell .skill-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.skill-cell .skill-head .num { color: var(--accent); }
.skill-cell .skill-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.skill-tag {
  font-size: 11.5px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-2);
  background: var(--bg);
  transition: all .15s ease;
}
.skill-tag:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
}

/* === Projects === */
.project-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.project {
  display: grid;
  grid-template-columns: 50px 1fr 1fr 120px;
  gap: 32px;
  padding: 28px 8px;
  border-top: 1px solid var(--line-2);
  align-items: start;
  cursor: default;
  transition: background .2s ease, padding .2s ease;
}
.project:last-child { border-bottom: 1px solid var(--line-2); }
.project:hover {
  background: var(--bg-elev);
  padding-left: 16px;
  padding-right: 16px;
}
.project .pnum {
  color: var(--mute-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}
.project h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.project .ptags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project .ptag {
  font-size: 10.5px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--mute);
  letter-spacing: 0.04em;
}
.project .pdesc {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 50ch;
}
.project .pmeta {
  font-size: 11px;
  color: var(--mute);
  text-align: right;
  letter-spacing: 0.05em;
}
.project .pmeta b { color: var(--ink); display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.project .arrow {
  display: inline-block;
  margin-left: 6px;
  color: var(--mute-2);
  transition: transform .2s ease, color .2s ease;
}
.project:hover .arrow { color: var(--accent); transform: translateX(4px); }

@media (max-width: 880px) {
  .project { grid-template-columns: 30px 1fr; }
  .project .pdesc, .project .pmeta { grid-column: 2; }
  .project .pmeta { text-align: left; margin-top: 8px; }
}

/* === Writing === */
.writing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 880px) {
  .writing-grid { grid-template-columns: 1fr; }
}
.note {
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: var(--bg-elev);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all .2s ease;
  position: relative;
  overflow: hidden;
}
.note:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -16px color-mix(in oklab, var(--accent) 35%, transparent);
}
.note .note-head {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.note .note-head .status-tag {
  color: var(--accent);
}
.note h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.35;
}
.note p {
  font-size: 12.5px;
  color: var(--mute);
  line-height: 1.55;
  flex: 1;
}
.note .note-foot {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--mute-2);
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  letter-spacing: 0.04em;
}

/* === Footer === */
.foot {
  padding: 80px 0 60px;
  border-top: 1px solid var(--line-2);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 720px) {
  .foot-grid { grid-template-columns: 1fr; }
}
.foot h3 {
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
  font-weight: 600;
  line-height: 1.1;
  max-width: 16ch;
}
.foot h3 .accent { color: var(--accent); }
.foot-col h4 {
  font-size: 11px;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  margin-bottom: 14px;
}
.foot-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.foot-col a {
  font-size: 13px;
  color: var(--ink-2);
  transition: color .15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.foot-col a:hover { color: var(--accent); }
.foot-col a .dot { color: var(--mute-2); }
.foot-col a:hover .dot { color: var(--accent); }

.copy {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.05em;
}

/* === Reveal animation === */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal.delay-1 { transition-delay: .06s; }
.reveal.delay-2 { transition-delay: .12s; }
.reveal.delay-3 { transition-delay: .18s; }
.reveal.delay-4 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .cursor { animation: none; }
  .status .dot { animation: none; }
}
