:root {
  --paper: #f4ede1;
  --ink: #1f1a17;
  --muted: #6e645b;
  --accent: #d9542b;
  --card: #fbf7f0;
  --line: #e2d7c5;
  --snap: #fffdf8;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17130f;
    --ink: #f2e9dc;
    --muted: #a3978a;
    --accent: #f0794f;
    --card: #211b16;
    --line: #362c24;
    --snap: #efe7da;
  }
}

* { box-sizing: border-box; margin: 0; }

html { background: var(--paper); }

body {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  isolation: isolate;
}

/* Dot grid, fading out from the top-right corner */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--ink) 22%, transparent) 1.1px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 90% 5%, #000 0%, rgba(0,0,0,.35) 55%, transparent 100%);
          mask-image: radial-gradient(ellipse 75% 70% at 90% 5%, #000 0%, rgba(0,0,0,.35) 55%, transparent 100%);
}

/* Paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  body::before { mix-blend-mode: screen; opacity: .12; }
}

main {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(48px, 12vh, 120px) 16px 64px;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 11vw, 7.5rem);
  line-height: .95;
  letter-spacing: -.035em;
  margin-bottom: 2rem;
}

h1 .line { display: block; }

h1 em {
  font-style: italic;
  color: var(--accent);
}

.intro {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  color: var(--muted);
  max-width: 30ch;
}

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

/* Hand-drawn underline */
.scribble {
  color: var(--ink);
  white-space: nowrap;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8c30-5 60-6 95-3s70 2 101-3' fill='none' stroke='%23d9542b' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") bottom / 100% .45em no-repeat;
  padding-bottom: .15em;
}

/* ---------- Tiles ---------- */

.tiles {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-top: clamp(48px, 9vh, 88px);
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--card);
  color: inherit;
  text-decoration: none;
}

.tile-num {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
}

/* Photos tile */
.tile-photos {
  padding: 24px;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease, border-color .3s ease;
}

.tile-photos:hover,
.tile-photos:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--accent) 45%, transparent);
}

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

.stack {
  position: relative;
  height: 210px;
  margin: 8px 0 28px;
}

.snap {
  --img: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 178px;
  margin: -89px 0 0 -75px;
  padding: 10px 10px 34px;
  background: var(--snap);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 24px -8px rgba(40,25,10,.35);
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}

.snap::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 1px;
  background: var(--img) center / cover, var(--fallback);
}

.s1 { --fallback: linear-gradient(160deg, #f6c47a 0%, #e9774a 55%, #7a3b52 100%); transform: rotate(-9deg) translateX(-34px); }
.s2 { --fallback: linear-gradient(200deg, #9fd3c7 0%, #4f8fa6 60%, #263f5c 100%); transform: rotate(5deg) translateX(30px); }
.s3 { --fallback: linear-gradient(180deg, #d7e3b0 0%, #7fa36a 55%, #3e5a3a 100%); transform: rotate(-1deg) translateY(-6px); }

.tile-photos:hover .s1, .tile-photos:focus-visible .s1 { transform: rotate(-16deg) translate(-110px, 8px); }
.tile-photos:hover .s2, .tile-photos:focus-visible .s2 { transform: rotate(13deg) translate(110px, 8px); }
.tile-photos:hover .s3, .tile-photos:focus-visible .s3 { transform: rotate(0deg) translateY(-16px) scale(1.04); }

.tile-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.tile-title {
  flex: 1;
  font-family: var(--serif);
  font-size: 2.25rem;
  line-height: 1;
  letter-spacing: -.02em;
}

.tile-arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 1.1rem;
  align-self: center;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), background .3s ease;
}

.tile-photos:hover .tile-arrow { transform: rotate(45deg); background: var(--accent); }

.tile-desc {
  margin-top: 8px;
  color: var(--muted);
  font-size: .95rem;
}

/* Placeholder tile */
.tile-soon {
  justify-content: space-between;
  padding: 24px;
  background: transparent;
  border-style: dashed;
}

.soon-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.6rem;
  line-height: 1.15;
  color: var(--muted);
}

/* ---------- Contact ---------- */

.contact {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 32px;
  margin-top: 16px;
  padding: clamp(24px, 4vw, 40px);
  border-radius: 20px;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}

/* Accent sun peeking in from the corner */
.contact::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -70px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .9;
}

.contact-text, .contact-actions { position: relative; }

.contact-eyebrow {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .6;
  margin-bottom: .5rem;
}

.contact h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: -.03em;
  margin-bottom: .75rem;
}

.contact h2 em { font-style: italic; color: var(--accent); }

.contact-intro {
  max-width: 34ch;
  opacity: .75;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mail-btn, .copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  font: inherit;
  font-size: .95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.mail-btn {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  word-break: break-all;
}

.mail-btn svg { flex: none; width: 20px; height: 20px; color: var(--accent); }

.mail-btn:hover { background: var(--accent); color: var(--paper); transform: translateY(-2px); }
.mail-btn:hover svg { color: currentColor; }

.copy-btn {
  background: transparent;
  color: var(--paper);
  border: 1px solid color-mix(in srgb, var(--paper) 35%, transparent);
}

.copy-btn:hover { border-color: var(--paper); }
.copy-btn.done { border-color: var(--accent); color: var(--accent); }

.mail-btn:focus-visible, .copy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.contact { animation: rise .7s cubic-bezier(.2,.8,.2,1) .48s both; }

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

footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 28px 16px;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
}

.sep { color: var(--accent); }

/* ---------- Entrance ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.eyebrow, h1 .line, .intro, .tiles {
  animation: rise .7s cubic-bezier(.2,.8,.2,1) both;
}
h1 .line:nth-child(1) { animation-delay: .08s; }
h1 .line:nth-child(2) { animation-delay: .16s; }
.intro { animation-delay: .26s; }
.tiles { animation-delay: .38s; }

/* ---------- Small screens ---------- */

@media (max-width: 680px) {
  .tiles { grid-template-columns: 1fr; }
  .tile-soon { min-height: 120px; }
  .scribble { white-space: normal; }
  .tile-photos:hover .s1, .tile-photos:focus-visible .s1 { transform: rotate(-14deg) translate(-80px, 8px); }
  .tile-photos:hover .s2, .tile-photos:focus-visible .s2 { transform: rotate(11deg) translate(80px, 8px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
