/*
===============================================================================
YUNUS EMRE VURGUN — "SCENERY" LAYER (the last core stylesheet)
===============================================================================
The main pages open on a painted place drawn live in three.js in a cel-shaded ink look
(assets/scenes/, views/includes/scene.php): the studio on the knoll above the fog, the study
with the CRT, a ferry on the Bosphorus, each in the light of the current hour in Istanbul.
The page title is a card pinned over the lower edge of the picture.

Everything around the pictures borrows their vocabulary: flat fills, an ink outline of the
same pine-black, and a hard "shade band" under raised things (keys, cards, the title card)
instead of soft glows. Bricolage Grotesque sets headings, keys and labels; Atkinson
Hyperlegible Next the reading text. Birch gold marks what is lit: the current page, the
focus ring, a hover.
===============================================================================
*/

:root {
  --ink: #17201b;
  --ink-line: rgba(23, 32, 27, 0.88);
  --ink-soft: rgba(23, 32, 27, 0.16);
  --ink-mid: rgba(23, 32, 27, 0.3);
  --paper: var(--color-bg-card);
  --shade-band: 0 4px 0 var(--ink);
  --shade-band-sm: 0 3px 0 var(--ink);
  --lift: 0 18px 34px -24px rgba(16, 26, 19, 0.55);
  --r-card: 18px;
  --r-key: 12px;
  --r-chip: 8px;
}

/* ===== TYPE ============================================================================ */
body {
  font-family: var(--font-body);
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
}

h1, h2, h3, h4,
.ui-section-title,
.ui-brief-title,
.ui-card-title,
.ui-project-title,
.ui-feed-title {
  font-family: var(--font-heading);
  font-optical-sizing: auto;
  letter-spacing: -0.015em;
}

.ui-section-title {
  font-weight: 700;
  line-height: 1.06;
}

h2.ui-section-title,
.ui-brief-title {
  font-weight: 650;
  font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.25rem);
  line-height: 1.1;
}

.ui-eyebrow {
  color: var(--color-accent);
  text-transform: uppercase;
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
}

::selection {
  background: rgba(227, 162, 39, 0.38);
  color: var(--ink);
}

/* ===== NAVBAR ========================================================================== */
.ui-navbar-wrap {
  background: rgba(251, 252, 249, 0.9);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1.5px solid var(--ink-soft);
  box-shadow: none;
}

.ui-navbar {
  background: transparent;
  box-shadow: none;
  border: 0;
}

.ui-wordmark {
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.ui-wordmark-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 0 0 1.5px var(--ink), var(--shade-band-sm);
}

.ui-nav-link,
.ui-nav-link-more {
  position: relative;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.97rem;
  letter-spacing: 0;
  color: var(--color-text-secondary);
  background: none;
  border-radius: 8px;
  box-shadow: none;
}

.ui-nav-link:hover,
.ui-nav-link-more:hover {
  color: var(--ink);
  background: rgba(23, 32, 27, 0.06);
}

/* The current page: ink text over a birch rule, the one lit thing in the bar. */
.ui-nav-link.is-active,
.ui-nav-link-more.is-active {
  color: var(--ink);
  background: none;
  box-shadow: none;
}

.ui-nav-link.is-active::after,
.ui-nav-link-more.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 3px;
  border-radius: 2px;
  background: var(--birch-500);
  box-shadow: 0 0 0 1px rgba(23, 32, 27, 0.35);
}

/* ===== THE SCENE ======================================================================= */
.ui-scene {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #a9c3dc;
  touch-action: pan-y;
}

.ui-scene[data-light="night"] {
  background: #1b2340;
}

.ui-scene picture,
.ui-scene .scene-poster {
  display: block;
  width: 100%;
  height: 100%;
}

.ui-scene .scene-poster {
  object-fit: cover;
  object-position: 50% 55%;
}

.ui-scene .scene-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  opacity: 0;
  transition: opacity 700ms ease;
  cursor: grab;
}

.ui-scene .scene-canvas:active {
  cursor: grabbing;
}

.ui-scene.is-live .scene-canvas {
  opacity: 1;
}

/* Inner pages: a full-bleed band right under the navbar, the page head pinned over its foot. */
.ui-scene-band {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: calc(-1 * var(--space-12));
  height: clamp(230px, 36vw, 470px);
  border-bottom: 2px solid var(--ink);
}

.ui-scene-band + .ui-section {
  position: relative;
  z-index: 2;
  margin-top: clamp(-120px, -7vw, -64px);
  max-width: 820px;
  padding: clamp(22px, 3vw, 34px) clamp(22px, 3.4vw, 40px) clamp(24px, 3vw, 34px);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--r-card);
  box-shadow: var(--shade-band), var(--lift);
}

/* ===== PAGE HEAD ======================================================================= */
.ui-main > .ui-section:first-of-type {
  position: relative;
  margin-bottom: var(--space-12);
}

.ui-main > .ui-section:first-of-type > .ui-eyebrow {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  background: none;
  color: var(--color-accent);
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: none;
  border-radius: 0;
}

.ui-main > .ui-section:first-of-type > .ui-section-title,
.ui-main > .ui-section:first-of-type > h1 {
  font-size: clamp(2rem, 1.45rem + 2.4vw, 3.15rem);
  font-weight: 750;
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 22ch;
  margin-bottom: 14px;
}

.ui-main > .ui-section:first-of-type .ui-section-text {
  color: var(--color-text-secondary);
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.15rem);
  max-width: 60ch;
}

.ui-main > .ui-section:first-of-type .ui-section-text a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* A page with no scene opens on plain paper with one rule under its head. */
.ui-main > .ui-section:first-of-type:not(.ui-scene-band + .ui-section) {
  padding-bottom: var(--space-8);
  border-bottom: 1.5px solid var(--ink-soft);
}

/* ===== KEYS ============================================================================ */
/* A flat face, an ink rim and a hard shade band; pressing pushes the key down into its band. */
.ui-btn,
.ui-btn-primary,
.ui-btn-secondary,
.ui-project-links .ui-case-link,
.ui-masthead-links a {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: 0;
  border: 2px solid var(--ink) !important;
  border-radius: var(--r-key) !important;
  box-shadow: var(--shade-band) !important;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, color 140ms ease;
}

.ui-btn-primary,
.ui-masthead-links a:first-child {
  background: var(--color-action) !important;
  color: #fbfcf9 !important;
}

.ui-btn-secondary,
.ui-project-links .ui-case-link,
.ui-masthead-links a:not(:first-child) {
  background: var(--paper) !important;
  color: var(--ink) !important;
}

.ui-btn::before, .ui-btn::after,
.ui-btn-primary::before, .ui-btn-primary::after,
.ui-btn-secondary::before, .ui-btn-secondary::after,
.ui-project-links .ui-case-link::before,
.ui-masthead-links a::before {
  display: none !important;
}

@media (hover: hover) {
  .ui-btn:hover,
  .ui-btn-primary:hover,
  .ui-btn-secondary:hover,
  .ui-project-links .ui-case-link:hover,
  .ui-masthead-links a:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 0 var(--ink) !important;
  }

  .ui-btn-primary:hover,
  .ui-masthead-links a:first-child:hover {
    background: var(--color-action-hover) !important;
  }

  .ui-btn-secondary:hover,
  .ui-project-links .ui-case-link:hover,
  .ui-masthead-links a:not(:first-child):hover {
    background: #fff6dc !important;
  }
}

.ui-btn:active,
.ui-btn-primary:active,
.ui-btn-secondary:active,
.ui-masthead-links a:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink) !important;
}

/* Filter keys and page numbers: smaller keys; the selected one is latched down in pine. */
.ui-filter-pill,
a.ui-page-link {
  font-family: var(--font-display);
  font-weight: 600;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shade-band-sm);
}

.ui-filter-pill:hover,
a.ui-page-link:hover {
  background: #fff6dc;
}

.ui-filter-pill.is-active,
.ui-filter-pill[aria-pressed="true"],
a.ui-page-link.is-active,
a.ui-page-link[aria-current="page"] {
  background: var(--ink);
  color: #fbfcf9;
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

/* ===== CARDS =========================================================================== */
.ui-project-card,
.ui-feed-card,
.ui-card,
.ui-record-section {
  background: var(--paper);
  border: 1.5px solid var(--ink-mid);
  border-radius: var(--r-card);
  box-shadow: 0 2px 0 var(--ink-soft);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

@media (hover: hover) {
  .ui-project-card:hover,
  .ui-feed-card:hover {
    border-color: var(--ink);
    box-shadow: var(--shade-band), var(--lift);
    transform: translateY(-2px);
  }
}

/* Part tags: a hairline chip in the label face. */
.ui-tech-tag {
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  padding: 3px 9px;
  border: 1.5px solid var(--ink-mid);
  border-radius: var(--r-chip);
  background: rgba(23, 32, 27, 0.035);
  box-shadow: none;
}

.ui-tech-tag::before {
  display: none;
}

/* Section icons: the drawn icon itself, large, no plate behind it. */
.ui-more-icon {
  width: 2.75rem;
  height: 2.75rem;
  background: none;
  box-shadow: none;
  border-radius: 0;
  color: var(--ink);
}

.ui-more-icon svg {
  width: 2.5rem;
  height: 2.5rem;
}

.ui-more-card:hover .ui-more-icon {
  background: none;
  transform: rotate(-4deg);
}

/* The announcement strip: the word "New" in birch, not a badge. */
.ebook-notice-marker {
  background: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: var(--birch-400) !important;
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ===== JOURNAL INDEX ==================================================================== */
/* Posts read as a ruled index: the date in its own column, the title large, no boxes. */
.ui-feed-list {
  gap: 0;
  border-bottom: 1.5px solid var(--ink-soft);
}

.ui-feed-list .ui-feed-card {
  background: none;
  border: 0;
  border-top: 1.5px solid var(--ink-soft);
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  transform: none;
}

.ui-feed-list .ui-feed-card:not(:has(> a)),
.ui-feed-list .ui-feed-card > a {
  display: grid !important;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  grid-template-areas: "meta title" "meta text";
  column-gap: var(--space-8);
  row-gap: 8px;
  padding: 26px 0 28px;
  color: inherit;
  text-decoration: none;
}

.ui-feed-list .ui-feed-title {
  grid-area: title;
  margin: 0;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
  font-weight: 680;
  line-height: 1.18;
  text-decoration: underline 2px transparent;
  text-underline-offset: 5px;
  transition: text-decoration-color 160ms ease;
}

.ui-feed-list .ui-feed-meta {
  grid-area: meta;
  margin: 6px 0 0;
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.ui-feed-list .ui-feed-text {
  grid-area: text;
  margin: 0;
  max-width: 68ch;
  color: var(--color-text-secondary);
}

@media (hover: hover) {
  .ui-feed-list .ui-feed-card:hover {
    transform: none;
    box-shadow: none;
  }

  .ui-feed-list .ui-feed-card:hover .ui-feed-title {
    text-decoration-color: var(--birch-500);
  }
}

@media (max-width: 640px) {
  .ui-feed-list .ui-feed-card:not(:has(> a)),
  .ui-feed-list .ui-feed-card > a {
    grid-template-columns: 1fr;
    grid-template-areas: "meta" "title" "text";
    padding: 20px 0 22px;
  }

  .ui-feed-list .ui-feed-meta {
    margin: 0;
  }
}

/* Timelines (about): an ink spine with birch stops. */
.ui-timeline-item {
  border-left: 2px solid var(--ink-mid);
}

.ui-timeline-item::before {
  background: var(--birch-500);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink);
}

/* Phone menu button: a small key. */
.ui-mobile-toggle {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: var(--shade-band-sm);
}

.ui-mobile-toggle span {
  background: var(--ink);
}

/* ===== FIELDS =========================================================================== */
.ui-input,
.ui-textarea,
.ui-select,
.ui-form input[type="text"],
.ui-form input[type="email"],
.ui-form textarea {
  background: var(--paper);
  border: 2px solid var(--ink-line);
  border-radius: var(--r-key);
  box-shadow: inset 0 2px 0 rgba(23, 32, 27, 0.06);
  color: var(--ink);
  font-size: max(16px, 1rem);
}

.ui-input:focus,
.ui-textarea:focus,
.ui-select:focus,
.ui-form input:focus,
.ui-form textarea:focus {
  border-color: var(--ink);
  outline: none;
  box-shadow: 0 0 0 4px rgba(227, 162, 39, 0.5);
}

/* ===== DIRECTORIES (home, /more, 404) =================================================== */
/* The same ruled index as the journal: two columns of rows, a drawn icon, no boxes. */
.ui-more-grid {
  column-gap: clamp(28px, 4vw, 56px);
  row-gap: 0;
  border-bottom: 1.5px solid var(--ink-soft);
}

.ui-more-card {
  grid-template-columns: 3.25rem minmax(0, 1fr);
  column-gap: 18px;
  padding: 22px 4px 24px;
  background: none;
  border: 0;
  border-top: 1.5px solid var(--ink-soft);
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.ui-more-card::before,
.ui-more-card::after {
  display: none;
}

.ui-more-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 680;
  color: var(--ink);
  text-decoration: underline 2px transparent;
  text-underline-offset: 5px;
  transition: text-decoration-color 160ms ease;
}

.ui-more-desc {
  color: var(--color-text-secondary);
}

@media (hover: hover) {
  .ui-more-card:hover {
    background: none;
    box-shadow: none;
    transform: none;
  }

  .ui-more-card:hover .ui-more-title {
    text-decoration-color: var(--birch-500);
  }
}

@media (max-width: 640px) {
  .ui-more-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== FOCUS =========================================================================== */
:focus-visible {
  outline: 2.5px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(227, 162, 39, 0.55);
}

/* ===== FOOTER ========================================================================== */
.ui-footer,
.ui-landing-footer {
  border-top: 2px solid var(--ink);
}

.ui-footer::before,
.ui-landing-footer::before {
  display: none;
}

.ui-footer-name {
  font-family: var(--font-display);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.ui-footer-heading {
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--birch-400);
}

/* ===== PHONES ========================================================================== */
@media (max-width: 640px) {
  .ui-scene-band {
    height: clamp(200px, 58vw, 280px);
  }

  .ui-scene-band + .ui-section {
    margin-top: -44px;
    border-radius: 16px;
  }
}

/* ===== MOTION ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .ui-scene .scene-canvas {
    display: none;
  }

  .ui-btn, .ui-btn-primary, .ui-btn-secondary, .ui-masthead-links a,
  .ui-more-card, .ui-project-card, .ui-feed-card {
    transition: none;
  }
}

@media (forced-colors: active) {
  .ui-scene-band + .ui-section,
  .ui-more-card, .ui-project-card, .ui-feed-card {
    border: 2px solid CanvasText;
  }
}

/* ===== MARGINALIA (assets/js/marginalia.js) ============================================ */
/* the skyline cut along the footer's top edge, redrawn on every visit */
.ui-footer {
  position: relative;
}

.ui-horizon {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: -2px;
  display: block;
  overflow: visible;
  pointer-events: none;
  color: var(--ink);
}

/* one leaf, gull or a few flakes crossing the margin now and then */
.ui-drifter {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 4;
  pointer-events: none;
  will-change: transform, opacity;
}

@media print {
  .ui-horizon, .ui-drifter { display: none; }
}
