/* Talosha portfolio — talosha.com
   World: the Order's night navy, one blue accent, Cinzel for names,
   Cormorant for the voice, Barlow for working text. */

:root {
  --ground: #0d1b2a;
  --ground-deep: #08121c;
  --ink: #f5f5f0;
  --body: #cdd7e2;
  --muted: #93a6ba;
  --accent: #4f9ce0;
  --accent-soft: rgba(79, 156, 224, 0.14);
  --line: rgba(205, 215, 226, 0.16);
  --line-strong: rgba(205, 215, 226, 0.42);
  --display: "Cinzel", "Cormorant Garamond", Georgia, serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Barlow", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(20px, 5vw, 88px);
  --header: var(--talosha-header-h, 84px);
}

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

html {
  background: var(--ground);
  color-scheme: dark;
  scroll-behavior: smooth;
  scrollbar-color: rgba(147, 166, 186, 0.35) var(--ground-deep);
  scrollbar-width: thin;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--body);
  background:
    radial-gradient(1100px 760px at 82% -8%, rgba(79, 156, 224, 0.13), transparent 62%),
    radial-gradient(900px 700px at -6% 62%, rgba(8, 18, 28, 0.9), transparent 70%),
    var(--ground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--accent);
}

::selection { background: var(--accent-soft); color: var(--ink); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }

.skip {
  position: fixed; left: 16px; top: -64px; z-index: 3000;
  padding: 10px 16px; background: var(--ink); color: var(--ground);
  font: 500 14px var(--sans); border-radius: 999px;
  transition: top .25s var(--ease);
}
.skip:focus { top: 12px; }

/* The header is fixed; keep the space it occupies before it hydrates. */
talosha-header { display: block; height: 0; }

/* ---- hero ---------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(24px, 4vw, 72px);
  padding: calc(var(--header) + clamp(32px, 6vh, 72px)) var(--gutter) clamp(56px, 9vh, 104px);
  overflow: clip;
}

.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.7rem, 6.2vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.hero__title .line > span { display: inline-block; }
.hero__title em { font-style: italic; font-weight: 500; color: var(--ink); }

.hero__lede {
  margin: clamp(22px, 3.4vh, 36px) 0 0;
  max-width: 46ch;
  font-size: clamp(1.05rem, 1.2vw, 1.2rem);
  color: var(--body);
}

.hero__actions {
  margin-top: clamp(28px, 4.4vh, 44px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 30px;
}

.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 26px 15px 28px;
  font: 500 13px/1 var(--sans);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink);
  background: rgba(79, 156, 224, 0.16);
  border: 1px solid rgba(79, 156, 224, 0.62);
  border-radius: 999px;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease); }
.btn:hover { background: rgba(79, 156, 224, 0.28); border-color: var(--accent); }
.btn:hover svg { transform: translateX(4px); }
.btn:active { transform: translateY(1px); }

.textlink {
  font: 500 13px/1 var(--sans);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--body);
  padding: 8px 0;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0% 1px no-repeat;
  transition: color .25s var(--ease), background-size .4s var(--ease);
}
.textlink:hover { color: var(--ink); background-size: 100% 1px; }

/* ---- hero mark ------------------------------------------------------ */
.hero__mark {
  position: relative;
  justify-self: center;
  width: min(100%, 560px);
  aspect-ratio: 1;
}
.geo { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 50%; animation: turn 180s linear infinite; }
.geo .r { stroke: rgba(205, 215, 226, 0.34); stroke-width: 1; vector-effect: non-scaling-stroke; }
.geo .r1 { stroke: rgba(205, 215, 226, 0.20); }
.geo .r3 { stroke: rgba(79, 156, 224, 0.5); }
.geo .tri { stroke: rgba(205, 215, 226, 0.24); }
.geo .ticks line { stroke: rgba(205, 215, 226, 0.34); stroke-width: 1; vector-effect: non-scaling-stroke; }

.emblem {
  position: absolute; left: 50%; top: 50%;
  width: 38%; height: auto; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 38px rgba(79, 156, 224, 0.28));
}

@keyframes turn { to { transform: rotate(360deg); } }

/* one authored moment: the lines rise, the geometry draws itself */
.js .hero__title .line > span { transform: translateY(105%); animation: rise 1.05s var(--ease) forwards; }
.js .hero__title .line:nth-child(2) > span { animation-delay: .12s; }
.js .hero__lede, .js .hero__actions { opacity: 0; transform: translateY(14px); animation: fade .9s var(--ease) .5s forwards; }
.js .hero__actions { animation-delay: .62s; }
.js .geo .r, .js .geo .ticks { opacity: 0; animation: bloom 1.4s var(--ease) .15s forwards; }
.js .geo .r2 { animation-delay: .28s; }
.js .geo .r3 { animation-delay: .4s; }
.js .geo .tri { animation-delay: .52s; }
.js .emblem { opacity: 0; animation: emblem 1.2s var(--ease) .45s forwards; }

@keyframes rise { to { transform: translateY(0); } }
@keyframes fade { to { opacity: 1; transform: none; } }
@keyframes bloom { to { opacity: 1; } }

/* Safety net: app.js adds .settled shortly after load, so content can never
   stay hidden if a browser throttles or skips the entrance animations. */
.settled .hero__title .line > span,
.settled .hero__lede,
.settled .hero__actions,
.settled .emblem,
.settled .geo .r,
.settled .geo .ticks { animation: none; opacity: 1; transform: none; }
.settled .emblem { transform: translate(-50%, -50%); }
@keyframes emblem { from { opacity: 0; transform: translate(-50%, -50%) scale(.94); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* ---- projects ------------------------------------------------------- */
.projects { padding: clamp(56px, 10vh, 120px) var(--gutter) clamp(40px, 7vh, 88px); }

.projects__head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end; gap: 12px 48px;
  padding-bottom: clamp(20px, 3vh, 32px);
}
.projects__head h2,
.writings h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.projects__head p { margin: 0; color: var(--muted); font-size: 1rem; max-width: 44ch; justify-self: end; }

.register { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }

.entry { border-top: 1px solid var(--line); position: relative; }
.entry__link {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) max-content;
  align-items: baseline;
  gap: 8px clamp(20px, 3vw, 56px);
  padding: clamp(26px, 4.4vh, 44px) 0;
  color: inherit;
}
.entry__id {
  display: flex; align-items: center; gap: clamp(14px, 1.6vw, 22px);
  min-width: 0;
  transition: transform .5s var(--ease);
}
.entry__mark {
  flex: none;
  width: 44px; height: 44px;
  object-fit: contain;
  transition: opacity .3s var(--ease), filter .3s var(--ease);
}
/* The house emblem stands in until a project has its own mark. */
.entry__mark.is-fallback { opacity: .42; }
.entry.is-live:hover .entry__mark.is-fallback { opacity: .7; }
.entry__name {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.1vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  text-wrap: balance;
  transition: color .3s var(--ease);
}
.entry__line {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.5vw, 1.4rem);
  line-height: 1.4;
  color: var(--body);
  max-width: 46ch;
  text-wrap: pretty;
}
.entry__meta {
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  font: 500 12.5px/1.3 var(--sans);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.entry__host { font-variant-numeric: tabular-nums; }
.entry__state {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--body);
}
.entry__arrow { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .45s var(--ease), color .3s var(--ease); }

/* hover rule draws across the row */
.entry::after {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .7s var(--ease);
  pointer-events: none;
}

.entry.is-live .entry__link { cursor: pointer; }
.entry.is-live:hover::after, .entry.is-live:focus-within::after { transform: scaleX(1); }
.entry.is-live:hover .entry__id, .entry.is-live:focus-within .entry__id { transform: translateX(14px); }
.entry.is-live:hover .entry__arrow, .entry.is-live:focus-within .entry__arrow { transform: translateX(6px); color: var(--accent); }
.entry.is-live .entry__state { border-color: rgba(79, 156, 224, 0.62); color: var(--ink); background: rgba(79, 156, 224, 0.12); }

.entry.is-soon .entry__name { color: rgba(245, 245, 240, 0.64); }
.entry.is-soon .entry__line { color: var(--muted); }
.entry.is-soon .entry__state { color: var(--muted); border-color: var(--line); }

.js .entry[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease) calc(var(--i, 0) * 70ms), transform .9s var(--ease) calc(var(--i, 0) * 70ms); }
.js .entry[data-reveal].in { opacity: 1; transform: none; }

/* ---- writings ------------------------------------------------------- */
.writings {
  padding: clamp(32px, 6vh, 72px) var(--gutter) clamp(64px, 11vh, 132px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px 48px; align-items: start;
}
.writings ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.writings li { border-bottom: 1px solid var(--line); }
.writings a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding: 22px 0;
}
.w-title { font-family: var(--serif); font-size: clamp(1.3rem, 1.8vw, 1.65rem); color: var(--ink); line-height: 1.25; transition: transform .5s var(--ease); }
.w-note { font: 500 12.5px/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); text-align: right; }
.writings a:hover .w-title { transform: translateX(14px); }

/* ---- footer --------------------------------------------------------- */
.foot {
  padding: clamp(40px, 7vh, 72px) var(--gutter) 40px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 32px;
  background: var(--ground-deep);
}
.foot__voice { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 1.8vw, 1.5rem); color: var(--ink); }
.foot__small { margin: 0; font: 500 12.5px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.foot__legal { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot__legal a {
  font: 500 12.5px/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 0;
  transition: color .25s var(--ease);
}
.foot__legal a:hover { color: var(--ink); }

/* ---- responsive ----------------------------------------------------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-bottom: 64px; }
  .hero__mark { grid-row: 1; width: min(78%, 380px); margin-bottom: 8px; }
  .projects__head { grid-template-columns: 1fr; }
  .projects__head p { justify-self: start; }
  .entry__link { grid-template-columns: 1fr; gap: 10px; }
  .entry__meta { justify-content: flex-start; flex-wrap: wrap; }
  .writings { grid-template-columns: 1fr; }
  .writings a { flex-direction: column; gap: 6px; }
  .w-note { text-align: left; }
  .entry.is-live:hover .entry__id, .entry.is-live:focus-within .entry__id { transform: none; }
  .entry__mark { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .geo { animation: none; }
  .js .hero__title .line > span,
  .js .hero__lede, .js .hero__actions, .js .emblem,
  .js .geo .r, .js .geo .ticks, .js .entry[data-reveal] { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
  .js .emblem { transform: translate(-50%, -50%) !important; }
}
