/* LIFE — ideaguy.co
   Layout and feel modeled on a quiet personal site:
   handwritten hello, centered portrait, narrow measure, generous space.
   Fonts are self-hosted OFL copies, not taken from any other site. */

@font-face {
  font-family: Caveat;
  src: url("/fonts/caveat.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/fonts/source-sans.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("/fonts/source-sans-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f4efe8;
  --ink: #1a1714;
  --muted: #5c564e;
  --accent: #8d3f24;
  --line: rgba(26, 23, 20, 0.12);
  --card: rgba(255, 250, 244, 0.7);
  --btn-bg: #8d3f24;
  --btn-ink: #fffaf4;
  --btn-bg-hover: #732f1a;
  --focus: #8d3f24;
  --hand: Caveat, "Segoe Script", "Bradley Hand", cursive;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --measure: 37.5rem;
  --gutter: clamp(1.25rem, 5vw, 2rem);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161311;
  --ink: #f4eee6;
  --muted: #b8afa4;
  --accent: #e8a788;
  --line: rgba(244, 238, 230, 0.14);
  --card: rgba(36, 30, 24, 0.7);
  --btn-bg: #e8a788;
  --btn-ink: #1a1714;
  --btn-bg-hover: #f3c0a6;
  --focus: #e8a788;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #161311;
    --ink: #f4eee6;
    --muted: #b8afa4;
    --accent: #e8a788;
    --line: rgba(244, 238, 230, 0.14);
    --card: rgba(36, 30, 24, 0.7);
    --btn-bg: #e8a788;
    --btn-ink: #1a1714;
    --btn-bg-hover: #f3c0a6;
    --focus: #e8a788;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1,
h2,
h3,
.wordmark,
.hello,
.kicker,
.thanks-lead {
  font-family: var(--hand);
  font-weight: 500;
  letter-spacing: 0;
}

h2,
h3 {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent);
}

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0.75rem;
  z-index: 100;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  text-decoration: none;
  font-weight: 600;
  transform: translateY(-220%);
}

.skip-link:focus {
  transform: none;
}

/* Header
   ------------------------------------------------------------------ */

.site-header {
  display: flex;
  align-items: center;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.15rem var(--gutter) 0;
}

.wordmark {
  font-size: 1.85rem;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.wordmark:hover {
  color: var(--accent);
}

.nav {
  flex: 1;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.35rem 0.6rem;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--ink);
}

.theme-toggle {
  margin-left: auto;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.theme-icon {
  display: none;
  line-height: 0;
}

:root:not([data-theme="dark"]) .theme-icon-moon,
[data-theme="light"] .theme-icon-moon {
  display: block;
}

[data-theme="dark"] .theme-icon-sun {
  display: block;
}

[data-theme="dark"] .theme-icon-moon,
[data-theme="light"] .theme-icon-sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-icon-moon {
    display: none;
  }
}


@media (max-width: 639px) {
  .site-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.15rem 0.75rem;
  }

  .wordmark {
    grid-column: 1;
    grid-row: 1;
  }

  .theme-toggle {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .nav ul {
    justify-content: space-between;
  }

  .nav a {
    padding: 0.3rem 0.15rem;
  }
}

/* Main column
   ------------------------------------------------------------------ */

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter) 4rem;
}

#subscribe,
#personal,
#professional,
#built,
#more,
#top {
  scroll-margin-top: 4.5rem;
}

/* Hero
   ------------------------------------------------------------------ */

.hero {
  padding-top: clamp(1.8rem, 6vw, 3.25rem);
  text-align: center;
}

.hello {
  margin: 0 0 1.4rem;
  font-size: clamp(3rem, 10vw, 4.6rem);
  font-weight: 600;
  line-height: 1.05;
}

.portrait {
  margin: 0 auto 1.8rem;
  max-width: 17.5rem;
}

.portrait img {
  width: 100%;
  margin: 0 auto;
}

.life-line,
.intro {
  text-align: left;
  margin: 0 0 1rem;
}

.life-line {
  font-size: 1.2rem;
  line-height: 1.55;
}

.intro {
  color: var(--muted);
  margin-bottom: 0;
}

/* Subscribe
   ------------------------------------------------------------------ */

.subscribe,
.life-section,
.built,
.coming-soon {
  padding-top: clamp(2.75rem, 7vw, 4.25rem);
}

.subscribe h2,
.life-section h2,
.built h2,
.coming-soon h2 {
  margin: 0 0 0.4rem;
  font-family: var(--hand);
  font-size: 2.05rem;
  font-weight: 600;
  letter-spacing: 0;
}

.section-intro {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.hello-form[hidden],
.thanks[hidden] {
  display: none;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.subscribe-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: stretch;
}

.field input {
  flex: 1 1 12rem;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.65rem 0.85rem;
  appearance: none;
}

.field input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: transparent;
}

.btn {
  font: inherit;
  font-weight: 600;
  color: var(--btn-ink);
  background: var(--btn-bg);
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  min-height: 2.7rem;
}

.btn:hover {
  background: var(--btn-bg-hover);
}

.form-error {
  margin: 0.6rem 0 0;
  color: var(--accent);
  font-size: 0.95rem;
}

.thanks {
  padding: 0.2rem 0;
}

.thanks:focus {
  outline: none;
}

.thanks-lead {
  margin: 0 0 0.4rem;
  font-size: 1.8rem;
  line-height: 1.2;
}

.thanks p:last-child {
  margin: 0;
  color: var(--muted);
}

/* Posts
   ------------------------------------------------------------------ */

.post-list,
.built-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-card {
  padding: 1.05rem 0;
  border-top: 1px solid var(--line);
}

.post-card:last-child {
  border-bottom: 1px solid var(--line);
}

.post-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.post-card h3 a {
  text-decoration: none;
}

.post-card h3 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}

.post-card p {
  margin: 0;
  color: var(--muted);
}

.post-meta {
  margin: 0 0 0.2rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.placeholder-flag {
  margin-left: 0.45rem;
  font-style: italic;
}

/* Built
   ------------------------------------------------------------------ */

.built-list li {
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.built-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.built-list strong {
  color: var(--ink);
  font-weight: 600;
}

/* Coming soon, posts, simple pages
   ------------------------------------------------------------------ */

.coming-soon p {
  margin: 0;
  color: var(--muted);
}

.post,
.simple {
  padding-top: clamp(2rem, 6vw, 3.25rem);
}

.post h1,
.simple h1 {
  margin: 0 0 0.5rem;
  font-family: var(--sans);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.kicker {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
}

.kicker a {
  color: var(--accent);
  text-decoration: none;
}

.kicker a:hover {
  text-decoration: underline;
}

.post-body {
  margin-top: 1.25rem;
}

.post-body p {
  margin: 0 0 1rem;
}

.back {
  margin: 2.25rem 0 0;
}

/* Footer
   ------------------------------------------------------------------ */

.site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem var(--gutter) 2.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .wordmark {
  font-size: 1.45rem;
  display: inline-block;
  margin-bottom: 0.2rem;
}

.site-footer p {
  margin: 0.15rem 0;
}

.site-footer small {
  font-size: 0.82rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
