/* =============================================================================
   DESIGN TOKENS — Black / white (edit here to retheme the whole site)
   ============================================================================= */

:root {
  --color-bg: #000000;
  --color-text: #f5f5f5;
  --color-text-muted: #a3a3a3;
  --color-border: rgba(255, 255, 255, 0.18);
  --color-link: #ffffff;
  --color-link-hover: #ffffff;

  --font-serif: "Times New Roman", Times, serif;
  --font-sans: "Times New Roman", Times, serif;

  --text-bio: clamp(0.95rem, 0.88rem + 0.35vw, 1.125rem);
  --text-nav: 0.8125rem;
  --text-footer: 0.75rem;
  --line-bio: 1.55;

  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  --content-max: 38rem;
  --page-pad: clamp(1rem, 4vw, 2.5rem);
}

@media (max-height: 640px) {
  :root {
    --text-bio: clamp(0.875rem, 0.8rem + 0.3vw, 1rem);
    --space-2xl: 1.75rem;
  }
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
  background-color: var(--color-bg);
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--color-text);
  /* Explicit black so the page is never “see-through” if html/bg stacking differs */
  background-color: var(--color-bg);
  color-scheme: dark;
  position: relative;
}

a {
  color: var(--color-link);
  text-underline-offset: 0.18em;
  transition: opacity 150ms ease;
}

a:hover {
  opacity: 0.85;
}

a:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ----- Skip link ----- */

.skip-link {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  padding: var(--space-xs) var(--space-sm);
  background: #f5f5f5;
  color: #000000;
  font-weight: 600;
  font-size: var(--text-nav);
  z-index: 100;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

.skip-link:focus {
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
}

/* =============================================================================
   HOMEPAGE — single viewport, no document scroll
   ============================================================================= */

body.is-home {
  height: auto;
  overflow-y: auto;
}

.home-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: var(--page-pad);
  padding-top: clamp(3rem, 8vh, 5rem);
  padding-bottom: var(--space-xl);
  max-width: var(--content-max);
  margin: 0 auto;
}

.is-home .site-header {
  flex-shrink: 0;
  padding-bottom: clamp(1.5rem, 3vh, 2.5rem);
}

.site-logo {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 1.6rem + 1.2vw, 2.8rem);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.05;
  -webkit-user-select: none;
  user-select: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-sm) var(--space-lg);
}

.site-nav a {
  font-size: var(--text-nav);
  font-weight: 400;
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--color-text);
}

.site-nav a[aria-current="page"] {
  color: var(--color-text);
}

.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.home-bio {
  margin-top: 0;
}

.home-bio p {
  margin: 0 0 var(--space-md);
  font-family: var(--font-serif);
  font-size: var(--text-bio);
  line-height: var(--line-bio);
  color: var(--color-text);
  font-weight: 400;
}

.home-bio p:last-of-type {
  margin-bottom: 0;
}

.home-bio a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

/* ----- Centered elements: contact + clock ----- */

.centered-contact {
  margin-top: var(--space-2xl);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-serif);
  font-size: var(--text-nav);
  color: var(--color-text-muted);
}

.centered-clock {
  margin-top: var(--space-xl);
  display: flex;
  justify-content: center;
}

.centered-clock .clock-widget__svg {
  width: 120px;
  height: 120px;
}

.centered-contact a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.centered-contact a:hover {
  opacity: 0.7;
}

.centered-contact__icon {
  text-decoration: none !important;
}

.centered-contact a svg {
  display: block;
}

.centered-contact__sep {
  color: var(--color-text-muted);
  user-select: none;
  opacity: 0.5;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .clock-widget__svg #hand-second {
    display: none;
  }
}

/* =============================================================================
   INTERIOR PAGES — About, Work (normal scroll)
   ============================================================================= */

body.is-interior {
  overflow-y: auto;
}

.interior-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: var(--page-pad);
  max-width: 90rem;
  margin: 0 auto;
}

.is-interior .site-header {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-lg);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-2xl);
}

.interior-main {
  flex: 1;
  max-width: var(--content-max);
  width: 100%;
}

.interior-main h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 500;
  margin: 0 0 var(--space-lg);
  color: var(--color-text);
}

.interior-main > p {
  font-family: var(--font-serif);
  font-size: var(--text-bio);
  line-height: var(--line-bio);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-lg);
}

.section-label {
  font-size: var(--text-nav);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-sm);
}

/* About cards */

.about__grid {
  display: grid;
  gap: var(--space-lg);
}

@media (min-width: 560px) {
  .about__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.about__card {
  border: 1px solid var(--color-border);
  padding: var(--space-lg);
}

.about__card h2 {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 500;
  margin: 0 0 var(--space-xs);
  color: var(--color-text);
}

.about__card p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* Work / projects */

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.project-card {
  border: 1px solid var(--color-border);
  padding: var(--space-lg);
  display: grid;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .project-card {
    grid-template-columns: 180px 1fr;
    align-items: start;
  }
}

.project-card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-border);
}

.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card__body h2 {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 500;
  margin: 0 0 var(--space-xs);
  color: var(--color-text);
}

.project-card__body > p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-sm);
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: 0 0 var(--space-sm);
  padding: 0;
  list-style: none;
}

.project-card__tags li {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  padding: 0.2rem 0.45rem;
}

.project-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.project-card__links a {
  font-size: var(--text-nav);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.interior-footer {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-footer);
  color: var(--color-text-muted);
}

.interior-footer a {
  color: var(--color-text-muted);
  text-decoration: underline;
}
