/* ─────────────────────────────────────────────────────────
   Stelios Gisdakis · personal page
   Editorial single-column. Strict left baseline, paper-and-ink
   palette, terracotta accent, no card framings inside sections.
   Inspired by patrickcollison.com, andy-bell.co.uk, and the
   typographic discipline of stripe.press.
   ─────────────────────────────────────────────────────────*/

:root {
  --bg:        #FAF7F2;
  --fg:        #1F1D1A;
  --muted:    #6F6A62;
  --rule:     #E1DACB;
  --accent:   #B85C3C;
  --paper:    #FFFEFB;

  --serif: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure:  40rem;            /* reading width for body copy */
  --content:  46rem;             /* shared content column width  */
  --gutter:   clamp(1.25rem, 4vw, 2.5rem);
  --rhythm:   clamp(4.5rem, 10vw, 7.5rem);  /* spacing between sections */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #14130F;
    --fg:     #EDE8DF;
    --muted:  #8F897C;
    --rule:   #2B281F;
    --paper:  #1A1814;
    --accent: #D77352;
  }
}
[data-theme="light"] { --bg:#FAF7F2;--fg:#1F1D1A;--muted:#6F6A62;--rule:#E1DACB;--paper:#FFFEFB;--accent:#B85C3C; }
[data-theme="dark"]  { --bg:#14130F;--fg:#EDE8DF;--muted:#8F897C;--rule:#2B281F;--paper:#1A1814;--accent:#D77352; }

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* scroll reveals — sections start translated + faded, JS adds .is-visible */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  background: var(--bg);
  color: var(--fg);
  font-feature-settings: "kern", "liga", "calt", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ── links ─────────────────────────────────────────── */
a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  transition: background-size .25s ease, color .2s ease;
  text-decoration-skip-ink: auto;
}
a:hover { color: var(--accent); background-size: 100% 2px; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  background: none;
  border-radius: 2px;
}

/* skip link */
.skip-link {
  position: absolute;
  top: -40px; left: 1rem;
  background: var(--fg); color: var(--bg);
  padding: .5rem 1rem; border-radius: 6px;
  z-index: 100;
}
.skip-link:focus { top: 1rem; }

/* ── nav ───────────────────────────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topnav .brand {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.25rem;
  background: none;
}
.topnav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0; padding: 0;
  font-size: .875rem;
  font-family: var(--sans);
}
.topnav ul a {
  background-size: 0% 1px;
  color: var(--muted);
  transition: color .2s ease, background-size .2s ease;
}
.topnav ul a:hover, .topnav ul a.is-active {
  color: var(--fg);
  background-size: 100% 1px;
}
.topnav ul a.is-active { color: var(--accent); }

@media (max-width: 640px) {
  .topnav ul { display: none; }
}

#theme-toggle {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--fg);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
#theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
#theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  #theme-toggle .icon-sun  { display: none; }
  #theme-toggle .icon-moon { display: block; }
}
[data-theme="dark"]  #theme-toggle .icon-sun  { display: none; }
[data-theme="dark"]  #theme-toggle .icon-moon { display: block; }
[data-theme="light"] #theme-toggle .icon-sun  { display: block; }
[data-theme="light"] #theme-toggle .icon-moon { display: none; }

/* ── shared content rail ───────────────────────────── */
main {
  max-width: var(--content);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* every direct child of <main> shares the same left edge.
   No nested cards, no offset side-columns, no special padding
   that breaks the vertical baseline. */
main > * {
  margin-left: 0;
  margin-right: 0;
}

/* ── hero ──────────────────────────────────────────── */
.hero {
  padding: clamp(3rem, 9vw, 6rem) 0 clamp(2.5rem, 7vw, 4rem);
  border-bottom: 1px solid var(--rule);
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 720px) {
  .hero-grid {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
  }
}

.portrait {
  margin: 0;
  width: 220px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  filter: grayscale(.15) contrast(1.02);
  background: var(--paper);
  box-shadow:
    0 0 0 1px var(--rule),
    0 30px 60px -25px color-mix(in oklab, var(--fg) 35%, transparent);
}

/* eyebrow & section labels — single style, single source of truth */
.eyebrow,
.section-label {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: .75rem;
}
.section-label { color: var(--accent); }
.section-label::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--accent);
}

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}
h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}

.tagline {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  line-height: 1.45;
  font-weight: 400;
  max-width: var(--measure);
  margin: 0 0 2rem;
  color: var(--fg);
  text-wrap: pretty;
}
.tagline strong { font-weight: 600; }
.tagline a { background-size: 100% 1px; color: var(--accent); }

/* ── logos / "previously" wordmark strip ───────────── */
.logos {
  padding: clamp(2rem, 5vw, 3.5rem) 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem clamp(1.25rem, 4vw, 3rem);
}
.logos-label {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: .75rem;
}
.logos-label::after {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--accent);
}
.logos ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem clamp(1.25rem, 3vw, 2.25rem);
  font-family: var(--serif);
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-style: italic;
  color: var(--muted);
  letter-spacing: -.005em;
}
.logos li { transition: color .25s ease, transform .25s ease; }
.logos li:hover { color: var(--fg); }

/* ── sections ──────────────────────────────────────── */
.section {
  padding: var(--rhythm) 0;
  border-bottom: 1px solid var(--rule);
}
.section:last-of-type { border-bottom: 0; }

.section h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.012em;
  margin: 0 0 2.5rem;
  max-width: 26ch;
  text-wrap: balance;
  color: var(--fg);
}

/* ── prose copy ────────────────────────────────────── */
.prose {
  max-width: var(--measure);
}
.prose p {
  margin: 0 0 1.25rem;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--fg);
}
.prose p:last-child { margin-bottom: 0; }
.prose a {
  background-size: 100% 1px;
  color: var(--fg);
  border-bottom: 0;
}
.prose a:hover { color: var(--accent); }
.prose .small { font-size: 1rem; line-height: 1.6; color: var(--muted); }
.prose .small a { color: var(--muted); }

/* ── quick links (hero CTAs and footer) ────────────── */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  list-style: none;
  margin: 0; padding: 0;
}
.quick-links a {
  display: inline-block;
  padding: .5rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: .875rem;
  background: none;
  transition: border-color .2s, color .2s, background .2s, transform .15s;
}
.quick-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.quick-links .primary {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
  font-weight: 500;
}
.quick-links .primary:hover {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}
.quick-links.bottom { margin-top: 2rem; }

/* ── services (flat numbered list, no card chrome) ─── */
.services {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: svc;
  border-top: 1px solid var(--rule);
}
.services li {
  counter-increment: svc;
  position: relative;
  padding: 1.75rem 0 1.75rem 4rem;
  border-bottom: 1px solid var(--rule);
  transition: padding-left .25s ease, color .2s ease;
}
.services li::before {
  content: counter(svc, decimal-leading-zero);
  position: absolute;
  left: 0; top: 1.85rem;
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--muted);
  letter-spacing: .05em;
  transition: color .2s;
}
.services li:hover { padding-left: 4.5rem; }
.services li:hover::before { color: var(--accent); }
.services h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0 0 .5rem;
  letter-spacing: -.005em;
  line-height: 1.25;
}
.services p {
  margin: 0;
  max-width: var(--measure);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--muted);
}

.services-note {
  margin: 2rem 0 0;
  font-size: .9375rem;
  color: var(--muted);
}
.services-note a { color: var(--accent); background-size: 100% 1px; }

/* ── timeline (inline dates, single baseline) ──────── */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.timeline li {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.timeline .when {
  font-family: var(--mono);
  font-size: .8125rem;
  letter-spacing: .05em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 .5rem;
}
.timeline h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0 0 .5rem;
  letter-spacing: -.005em;
  line-height: 1.25;
}
.timeline h3 .at {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
}
.timeline p {
  margin: 0;
  max-width: var(--measure);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ── contact ───────────────────────────────────────── */
.contact { padding-bottom: var(--rhythm); }
.contact-line {
  font-family: var(--serif);
  font-size: clamp(1.375rem, 3vw, 1.875rem);
  font-style: italic;
  letter-spacing: -.005em;
  line-height: 1.4;
  margin: 0;
  text-wrap: pretty;
}
.contact-line a {
  color: var(--fg);
  background-size: 100% 1px;
}
.contact-line a:hover { color: var(--accent); }
.contact-line .sep {
  color: var(--rule);
  margin: 0 .6em;
  font-style: normal;
  font-size: .85em;
}

/* ── footer ────────────────────────────────────────── */
.site-footer {
  max-width: var(--content);
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 4rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 2rem;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: .8125rem;
  letter-spacing: .03em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ── print ─────────────────────────────────────────── */
@media print {
  .topnav, #theme-toggle, .skip-link { display: none; }
  body { background: white; color: black; font-size: 11pt; }
  a { color: inherit; background: none; }
  .section, .hero { page-break-inside: avoid; border-color: #ccc; }
  .portrait img { box-shadow: none; }
}
