/* site.css — the one stylesheet of the coming-soon site, linked by the home and the cards page (T-053, T-054, F-01, F-03, C-008).
 *
 * Holds every rule of both pages: page layout, hero, language blocks, buttons, the section of cards,
 * footer, and the shared header bar with its navigation. Plain CSS, no build step; each page links it as
 * `site.css`. Map: system-coming-soon.
 *
 * Contents:
 *   :root … .project-card .btn  the rules moved unchanged from index.html's former <style> (custom properties first),
 *                             except `.page` (T-068: no vertical centring, so the header bar stays at the top)
 *                             and `.project-card` (T-084: the card is the `details` element's box; its old
 *                             `.project-card h3` rule is gone, titles are spans in the summary)
 *   .project-summary …        the card's toggle, placed between `.project-card .btn` and `footer`: summary,
 *                             marker, focus ring, picture order, titles, body, open banner, and no scroll
 *                             anchoring on closed cards (T-084), and the open fade (T-085)
 *   footer                    the page footer, moved unchanged
 *   .site-header              the header bar: a wrapping row, the home ring's corner kept free above 30em (T-068)
 *   .site-header a, :focus-visible  every link of the bar: at least 44 px tall, focus outline as .btn (T-068 I7)
 *   .site-mark                the `.tykho` mark linking to `/` (T-068)
 *   .site-header nav …        the two-link navigation, scoped to the bar so a later nav starts unstyled (T-068 I6)
 *   .project-thumb            the card's image: full width, one fixed 3:2 ratio, cropped, the card's radius (T-054 I8)
 */

:root {
  --bg: #f7f3ec;
  --fg: #111111;
  --fg-muted: #4a4a47;
  --accent: #047857;
  --border: rgba(17, 17, 17, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Helvetica,
    Arial,
    sans-serif;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

a {
  color: inherit;
}

.page {
  position: relative;
  width: 100%;
  max-width: 40rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: 1.5rem 1.5rem 3rem;
}

.accent {
  position: absolute;
  color: var(--fg);
  opacity: 0.9;
  pointer-events: none;
}

.accent--ring {
  top: 2rem;
  right: 1.5rem;
  width: 4.5rem;
  height: 4.5rem;
}

@media (max-width: 30em) {
  .accent--ring {
    display: none;
  }
}

.accent--viewfinder {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--fg-muted);
  opacity: 1;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.5rem;
  text-transform: uppercase;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--fg-muted);
}

.eyebrow svg {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--fg-muted);
}

h1.wordmark {
  margin: 0 0 1.25rem;
  font-weight: 500;
  font-size: clamp(2.75rem, 9vw, 5rem);
  letter-spacing: -0.01em;
  line-height: 1;
}

.tagline {
  margin: 0;
  max-width: 34rem;
  font-weight: 300;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--fg);
}

.tagline .divider {
  margin: 0 0.5em;
  color: var(--fg-muted);
}

.lang-block {
  margin: 0;
}

.lang-divider {
  display: block;
  width: 4.5rem;
  height: auto;
  margin: 1.75rem 0;
  color: var(--fg-muted);
}

.lang-label {
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--fg-muted);
}

.lang-block p {
  margin: 0;
  max-width: 38rem;
  font-size: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1.6rem;
  border: 1.5px solid var(--fg);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fg);
  background: transparent;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--fg);
  color: var(--bg);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.btn:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

#projects {
  margin-top: 3rem;
}

#projects h2 {
  margin: 0 0 1.25rem;
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fg-muted);
}

.project-card {
  margin: 0 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow-wrap: anywhere;
}

.project-card p {
  margin: 0 0 0.4rem;
}

.project-when {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
}

.project-description {
  white-space: pre-line;
}

.project-details,
.project-location {
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.project-card .btn {
  align-self: flex-start;
}

/* The whole bordered card is one toggle (T-084): the summary carries the padding, so a closed card's border wraps it alone.
   A flex summary shows no marker in Chromium and Firefox; the second rule hides Safari's. */
.project-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  min-height: 44px;
  cursor: pointer;
  border-radius: 1rem;
}

.project-summary::-webkit-details-marker {
  display: none;
}

/* Focus ring as .btn's (T-084 I8). */
.project-summary:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

/* The picture is last in the DOM (so the accessible name reads titles, date, alt) and first on screen. */
.project-summary .project-thumb {
  order: -1;
}

.project-title {
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.25;
}

/* The closed body is hidden by the browser's `details` alone (T-084 I4); this rule only lays it out. */
.project-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1.5rem 1.5rem;
}

/* An open card's picture widens into a 16:9 banner (T-084 I7). */
.project-toggle[open] .project-thumb {
  aspect-ratio: 16 / 9;
}

/* Scroll anchoring would keep a tall open card's content in place and move the newly opened card out of view
   (T-084 B4, measured: its summary ended 5115 px above the viewport), so closed cards opt out of anchoring. */
.project-card:not(:has(> .project-toggle[open])) {
  overflow-anchor: none;
}

/* An opening card fades its details in over 200 ms (T-085 I1). Only the open state carries the transition, so
   closing is instant; `reduce` matches no rule, so the card opens at once as in T-084. The box is
   `::details-content`, which the browser keeps hidden while closed, so find-in-page still reaches it.
   Not `.project-body`: a closed `details` keeps its slotted body's old computed style, so a transition on
   the body fades only the first open (T-056 measured); the pseudo-element restyles on every open. */
@media (prefers-reduced-motion: no-preference) {
  .project-toggle::details-content {
    opacity: 0;
  }

  .project-toggle[open]::details-content {
    opacity: 1;
    transition: opacity 200ms ease-out;
  }
}

footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
}

/* The shared header bar (T-068): the .tykho mark, then the navigation, left-packed in one wrapping row.
   It scrolls away with the page (position stays static). */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
}

/* The home page's ring sits in the bar's top-right corner wherever it is shown (its rule hides it up to
   30em): keep the links out from under it, on both pages so the bar is the same on each. */
@media (not (max-width: 30em)) {
  .site-header {
    padding-inline-end: 6rem;
  }
}

/* Every link in the bar, mark and navigation alike: at least 44 px tall to tap, outline as .btn (T-053 I3). */
.site-header a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-header a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.site-mark {
  font-size: 1.1rem;
  font-weight: 500;
  text-decoration: none;
}

/* Scoped to the bar: a later nav elsewhere on a page starts unstyled (T-068 I6). */
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.site-header nav a[aria-current='page'] {
  text-decoration: none;
}

/* The card's image (T-054): full width, one fixed 3:2 box so nothing shifts while it loads, cropped to fit, the card's radius. */
.project-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 1rem;
}
