/*
  Typography and layout definitions inspired by gmaurovich.com.  The
  custom fonts are bundled in the repository and loaded via
  @font-face.  Variables are used to centralise colours and fonts.
*/

@font-face {
  font-family: 'Switzer';
  src: url('fonts/WEB/fonts/Switzer-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Switzer';
  src: url('fonts/WEB/fonts/Switzer-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Switzer';
  src: url('fonts/WEB/fonts/Switzer-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Switzer';
  src: url('fonts/WEB/fonts/Switzer-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Switzer';
  src: url('fonts/WEB/fonts/Switzer-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --sans: 'Switzer', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --serif: 'Switzer', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --background: #ffffff;
  --details: #e9e9e9; /* lighten for hairline */
  --text-primary: #000000;
  --text-secondary: #666666;
  --column-gap: 2rem;
  --intro-offset: 0; /* removed offset for better alignment */
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Site header */
/* Horizontal header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: transparent; /* fully transparent so text shows under */
  backdrop-filter: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.75rem 2rem 0.25rem; /* smaller header */
  border-bottom: none;
}
.site-title {
  margin: 0;
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.85rem, 5.5vw, 4rem); /* slightly smaller */
  line-height: 0.9;
  letter-spacing: -0.05em; /* tighter tracking */
  background: transparent;
}
.site-header nav a { text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; }

/* Background vertical guides at 1/3 and 2/3 like reference */
.col-guides,
.with-guides,
.with-guides .site-header {
  background-image: linear-gradient(to right, var(--details) 1px, transparent 1px);
  background-size: 33.333% 100%;
}
/* Ensure header's background is transparent so lines show through */
.site-header { background-color: transparent; }

/* Grid layout */
.container {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  grid-template-rows: auto auto;
  min-height: 100vh;
  position: relative;
}

/* Tiny MENU label not used with horizontal header */
.menu-label { display: none; }

.column {
  padding: 2rem;
  border-right: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.column:last-child { border-right: none; }

/* Section indicator in left column */
.section-indicator {
  position: sticky;
  top: 14vh;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.4;
  color: var(--text-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
  letter-spacing: -0.01em;
}

/* Content sections */
#intro { 
  grid-column: 2 / 4; 
  padding-top: 14vh;
}

.content-section {
  min-height: 100vh;
}

#home {
  font-family: var(--serif); 
  font-size: 1.35rem; 
  line-height: 1.75; 
  text-align: left; 
  padding-right: 2rem;
  letter-spacing: -0.05em;
}

/* Essays section */
#essays {
  padding-top: 8vh;
  margin-left: 0;
}

.essays-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
}

.essay-link {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: baseline;
  text-decoration: none;
  color: var(--text-primary);
  padding: 0.65rem 0;
  border-bottom: 1px solid transparent;
  transition: opacity 0.2s ease;
}

.essay-link:hover {
  opacity: 0.6;
}

.essay-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
  padding-right: 2rem;
}

.essay-meta {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.4;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  text-align: left;
}

/* Contact section */
#contact {
  padding-top: 8vh;
  margin-left: 0;
}

.contact-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
}

.contact-link {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: baseline;
  text-decoration: none;
  color: var(--text-primary);
  padding: 0.65rem 0;
  border-bottom: 1px solid transparent;
  transition: opacity 0.2s ease;
}

.contact-link:hover {
  opacity: 0.6;
}

.contact-platform {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
  padding-right: 2rem;
}

.contact-handle {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.4;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  text-align: left;
}

.middle p {
  margin-bottom: 1.1rem; /* slightly tighter between lines visually */
  margin-left: 0;
  max-width: 82ch; /* bring lines closer to each other horizontally */
  font-size: 1.1rem;
  line-height: 2; /* vertical rhythm preserved */
  text-align: justify;
  text-justify: inter-word;
}

@media (min-width: 1200px) {
  .middle p { max-width: 100ch; }
}

/* Space Grotesk body for intro paragraph */
.intro-text { font-family: var(--serif); }

/* Subtle keyword animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.highlight-fade {
  display: inline-block;
  animation: fadeUp 420ms ease-out both;
  animation-delay: var(--delay, 0s);
}

/* Underline reveal for links */
.underline-reveal { position: relative; text-decoration: none; }
.underline-reveal::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 220ms ease;
}
.underline-reveal:hover::after,
.underline-reveal:focus-visible::after { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .highlight-fade { animation: none !important; }
  .underline-reveal::after { transition: none !important; }
}

/* Boxed chips like reference */
.tag,
.boxed,
a.tag {
  display: inline-block;
  margin-right: 0.3rem;
  padding: 0.08rem 0.35rem;
  border: 1px solid var(--text-primary);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 0.9em;
  vertical-align: baseline;
  color: inherit;
  text-decoration: none;
}
.tag:hover,
.boxed:hover,
a.tag:hover { text-decoration: none; background: #000; color: #fff; transition: background 160ms ease, color 160ms ease; }

/* Contact-like chip */
.contact {
  border: 1px solid var(--text-primary);
  padding: 0.05rem 0.25rem;
  border-radius: 2px;
  text-decoration: none;
  color: inherit;
  font-family: var(--sans);
  font-size: 0.85em;
}
.contact:hover { text-decoration: underline; }

/* Underline utility */
.u-underline { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: #bfbfbf; }
.u-underline:hover { text-decoration-color: #646464; }

/* Focus ring (a11y) */
:where(a, button, .tag, .contact).focus-visible,
:where(a, button, .tag, .contact):focus-visible {
  outline: 1px solid #666;
  outline-offset: 2px;
}

/* Legacy section styles removed/neutralized */
.sections { display: none; }
.panel { padding: 0; border: none; }
.panel h2 { margin: 0; }
.experience-list { display: none; }
.panel a { color: inherit; text-decoration: none; }
.panel a:hover { text-decoration: underline; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Responsive */
@media (max-width: 900px) {
  .site-header { padding: 0.5rem 1rem; background: transparent; border-bottom: none; }
  .site-title { font-size: clamp(1.5rem, 8vw, 2.25rem); }
  .container { grid-template-columns: 1fr; }
  .column { padding: 1rem; border-right: none; border-bottom: none; }
  .section-indicator { display: none; }
  #intro { grid-column: 1 / -1; padding: 12vh 1rem 0 1rem; }
  #home { margin-left: 0; padding: 0 1rem; }
  #essays { padding: 0 1rem; }
  #contact { padding: 0 1rem; }
  .contact-link { grid-template-columns: 1fr; gap: 0.25rem; }
  .contact-handle { text-align: left; font-size: 0.9rem; color: var(--text-secondary); }
  .essay-link { grid-template-columns: 1fr; gap: 0.25rem; }
  .essay-meta { text-align: left; font-size: 0.9rem; color: var(--text-secondary); }
  .sections { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .when { text-align: left; }
  
  /* Remove vertical grid lines on mobile */
  .with-guides,
  .with-guides .site-header,
  .col-guides {
    background-image: none !important;
  }
}