/* =================================================================
   Milad Zarei — Personal Operating System
   Serif (Fraunces) × Mono (JetBrains Mono) · warm-monochrome + amber
   ================================================================= */

/* ---------- tokens ---------- */
:root {
  --bg:        #0a0908;
  --bg-2:      #100e0c;
  --surface:   rgba(255, 255, 255, 0.022);
  --surface-2: rgba(255, 255, 255, 0.045);
  --line:      rgba(244, 241, 234, 0.09);
  --line-2:    rgba(244, 241, 234, 0.16);

  --text:      #f4f1ea;
  --text-dim:  #a7a199;
  --text-faint:#6c665e;

  --accent:    #e6b25c;          /* warm amber */
  --accent-2:  #f0c987;
  --accent-ink:#1a1304;
  --accent-glow: rgba(230, 178, 92, 0.5);

  --live:      #7fd4a6;
  --building:  #e6b25c;
  --studio:    #9db4d8;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --max:    min(1140px, 92vw);
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease-2: cubic-bezier(0.16, 1, 0.3, 1);

  --pad-block: clamp(2rem, 6vh, 4.5rem);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(15px, 1vw + 0.6rem, 17px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  /* layered ambient background */
  background-image:
    radial-gradient(120% 90% at 12% -10%, rgba(230, 178, 92, 0.10), transparent 55%),
    radial-gradient(90% 70% at 100% 0%,  rgba(157, 180, 216, 0.06), transparent 50%),
    radial-gradient(120% 120% at 50% 120%, rgba(230, 178, 92, 0.05), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

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

/* ---------- atmosphere overlays ---------- */
.spotlight {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(
    540px circle at var(--mx, 50%) var(--my, 30%),
    rgba(230, 178, 92, 0.08), transparent 60%);
  opacity: 0; transition: opacity 0.6s var(--ease);
  mix-blend-mode: screen;
}
.grain {
  position: fixed; inset: -50%; z-index: 2; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-drift 8s steps(6) infinite;
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(130% 110% at 50% 40%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

@keyframes grain-drift {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -2%); }
  60% { transform: translate(-2%, 2%); }
  80% { transform: translate(2%, 3%); }
}

/* ---------- skip link ---------- */
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.6rem 1rem; border-radius: 8px;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 600;
  transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- frame / layout ---------- */
.frame {
  position: relative; z-index: 3;
  width: var(--max);
  margin-inline: auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-block: clamp(1.4rem, 4vh, 2.4rem);
}

/* =================================================================
   TOP BAR  (the "OS" chrome)
   ================================================================= */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding-bottom: clamp(1.4rem, 5vh, 3rem);
}

.wordmark {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-family: var(--mono); font-weight: 600;
  font-size: 0.82rem; letter-spacing: 0.18em;
  color: var(--text);
  padding: 0.5rem 0.8rem 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  backdrop-filter: blur(6px);
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease), transform 0.4s var(--ease);
}
.wordmark:hover { border-color: var(--line-2); background: var(--surface-2); }
.wordmark:hover .wordmark__lights i:nth-child(1) { background: #f0654f; }
.wordmark:hover .wordmark__lights i:nth-child(2) { background: var(--accent); }
.wordmark:hover .wordmark__lights i:nth-child(3) { background: var(--live); }

.wordmark__lights { display: inline-flex; gap: 5px; }
.wordmark__lights i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line-2);
  transition: background 0.4s var(--ease);
}
.caret {
  color: var(--accent);
  animation: blink 1.2s steps(1) infinite;
}
@keyframes blink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }

.topbar__meta { display: inline-flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em;
  color: var(--text-dim);
  padding: 0.42rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
}
.meta-chip__label { color: var(--text-faint); letter-spacing: 0.12em; }
.meta-chip--time time { color: var(--text); font-variant-numeric: tabular-nums; }

.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(127, 212, 166, 0.6);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(127, 212, 166, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(127, 212, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(127, 212, 166, 0); }
}

/* =================================================================
   MAIN PANEL
   ================================================================= */
.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(2rem, 5vh, 3.4rem);
}

/* ---------- shared labels ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 0.7rem;
}
.eyebrow__idx, .section-label__idx {
  color: var(--accent);
  font-weight: 600;
  font-feature-settings: "tnum";
}

.section-label {
  font-family: var(--mono); font-weight: 500;
  font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-dim);
  display: flex; align-items: center; gap: 0.7rem;
  margin-bottom: 1.5rem;
}
.section-label::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
}

/* =================================================================
   HERO
   ================================================================= */
.hero {
  position: relative;
  display: grid;
  gap: clamp(1.2rem, 3vh, 1.8rem);
}

.hero__title {
  font-family: var(--serif);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.018em;
  display: grid;
  gap: 0.1em;
  margin-top: 0.2rem;
  min-width: 0;
  max-width: 100%;
}
.hero__title .line:first-child {
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  color: var(--text-dim);
  font-style: italic;
  font-weight: 400;
}
.hero__lead {
  font-size: clamp(1.9rem, 10.5vw, 6.4rem);
  font-weight: 400;
  color: var(--text);
  font-optical-sizing: auto;
  text-wrap: balance;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.hero__lead .amp {
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
}

.hero__body {
  font-family: var(--mono);
  font-size: clamp(0.92rem, 0.5vw + 0.8rem, 1.05rem);
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 46ch;
  text-wrap: pretty;
}

/* abstract avatar — floats top-right on wide screens */
.avatar {
  --size: clamp(76px, 9vw, 124px);
  position: absolute;
  top: 0; right: 0;
  width: var(--size); height: var(--size);
  display: grid; place-items: center;
  opacity: 0.95;
}
.avatar img {
  width: 76%; height: 76%;
  object-fit: contain;
  /* original black line-art on a light disc → always legible */
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}
.avatar__ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.6);
  background:
    radial-gradient(120% 120% at 30% 18%, #ffffff, #efe9dd 78%, #e3d8c4 100%);
  box-shadow:
    0 10px 30px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.9);
}
.avatar__ring::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  background: conic-gradient(from 140deg, transparent, var(--accent-glow), transparent 55%);
  opacity: 0.55;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1.5px));
  animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- divider ---------- */
.rule {
  border: 0; height: 1px;
  background: linear-gradient(90deg, var(--line-2), var(--line), transparent);
}

/* =================================================================
   VENTURES
   ================================================================= */
.venture-list { display: grid; gap: 2px; }

.venture__link {
  --p: clamp(0.9rem, 2vw, 1.15rem);
  display: grid;
  grid-template-columns: minmax(0,auto) 1fr auto auto;
  align-items: baseline;
  gap: clamp(0.8rem, 2vw, 1.6rem);
  padding: var(--p) 0.4rem var(--p) 0.2rem;
  border-radius: 12px;
  position: relative;
  transition: background 0.45s var(--ease), padding 0.45s var(--ease);
  isolation: isolate;
}
.venture__link::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--surface-2), transparent 70%);
  opacity: 0; transform: scaleX(0.97);
  transform-origin: left;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.venture__link:hover::before,
.venture__link:focus-visible::before { opacity: 1; transform: scaleX(1); }
.venture__link:hover, .venture__link:focus-visible {
  padding-left: 1.1rem; padding-right: 1.1rem;
}

.venture__name {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 3.6vw, 2.3rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1;
  transition: color 0.3s var(--ease);
}
.venture__link:hover .venture__name { color: var(--accent-2); }

.venture__desc {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-faint);
  letter-spacing: 0.01em;
  justify-self: start;
}

.venture__tag {
  font-family: var(--mono);
  font-size: 0.64rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.3em 0.65em;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--text-dim);
  white-space: nowrap;
  align-self: center;
}
.venture__tag[data-state="live"]     { color: var(--live);     border-color: rgba(127,212,166,0.35); }
.venture__tag[data-state="building"] { color: var(--building); border-color: rgba(230,178,92,0.35); }
.venture__tag[data-state="studio"]   { color: var(--studio);   border-color: rgba(157,180,216,0.35); }

.venture__arrow {
  font-family: var(--mono);
  color: var(--text-faint);
  font-size: 1.1rem;
  align-self: center;
  transform: translateX(-6px);
  opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease), color 0.3s var(--ease);
}
.venture__link:hover .venture__arrow,
.venture__link:focus-visible .venture__arrow {
  opacity: 1; transform: translateX(0); color: var(--accent);
}

/* =================================================================
   CONTACT
   ================================================================= */
.links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px clamp(1rem, 4vw, 3rem);
}
.link {
  display: flex; align-items: baseline; gap: 0.9rem;
  padding: 1rem 1rem 1rem 0.2rem;
  border-radius: 10px;
  position: relative;
  transition: padding 0.4s var(--ease), background 0.4s var(--ease);
}
.link::after {
  content: ""; position: absolute; left: 0.2rem; right: 1rem; bottom: 0.7rem;
  height: 1px; background: var(--line);
  transform: scaleX(1); transform-origin: left;
  transition: background 0.4s var(--ease);
}
.link__key {
  font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-faint);
  min-width: 5.2em;
}
.link__val {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  color: var(--text-dim);
  transition: color 0.3s var(--ease), transform 0.4s var(--ease);
}
.link:hover { background: var(--surface); padding-left: 0.8rem; }
.link:hover::after { background: var(--accent); }
.link:hover .link__val { color: var(--text); }
.link:hover .link__key { color: var(--accent); }

/* =================================================================
   FOOTER
   ================================================================= */
.footer {
  margin-top: clamp(2.4rem, 7vh, 4.5rem);
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--text-faint);
}
.footer__sig { color: var(--text-dim); font-weight: 500; }
.footer__note { font-style: italic; }

/* =================================================================
   FOCUS STATES
   ================================================================= */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}
a:focus-visible { outline-offset: 6px; }

/* =================================================================
   REVEAL ANIMATION (staggered load)
   ================================================================= */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(6px);
}
.is-ready .reveal {
  animation: reveal-in 1s var(--ease-2) forwards;
  animation-delay: calc(var(--d, 0) * 80ms);
}
@keyframes reveal-in {
  to { opacity: 1; transform: none; filter: blur(0); }
}

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 680px) {
  .avatar {
    position: static;
    --size: 72px;
    justify-self: start;
    order: -1;
    margin-bottom: 0.4rem;
  }
  .hero { gap: 1.1rem; }
  .venture__link {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name tag"
      "desc arrow";
    row-gap: 0.5rem;
  }
  .venture__name { grid-area: name; }
  .venture__desc { grid-area: desc; }
  .venture__tag  { grid-area: tag; justify-self: end; }
  .venture__arrow { grid-area: arrow; justify-self: end; opacity: 1; transform: none; }
  .venture__link:hover, .venture__link:focus-visible { padding-left: 0.6rem; padding-right: 0.6rem; }
  .links { grid-template-columns: 1fr; }
  .link { padding-bottom: 1.2rem; }
  .link__val { font-size: 1.05rem; }
  .footer { justify-content: flex-start; gap: 1rem; }
}

@media (max-width: 400px) {
  .topbar__meta .meta-chip--time { display: none; }
}

/* =================================================================
   REDUCED MOTION
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; filter: none; }
  .grain, .spotlight { display: none; }
  .caret { opacity: 1; }
}
