/* ============================================================
   K. A. Keener — "Field Notebook"
   A hand-drawn, watercolor-and-ink identity inspired by an
   urban-sketch of the NYC coffee skyline: ink linework, soft
   washes of sky blue and peach, warm paper, generous margins.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
  /* Ink + paper */
  --ink: #1d1c1a;
  --ink-soft: #514e48;
  --paper: #fdf8f6;          /* coral-blush paper */
  --paper-2: #fcf5f1;        /* deeper blush for cards/surfaces */

  /* Watercolor washes, straight from the sketch */
  --wash-blue: #cfe2f2;
  --wash-blue-deep: #9fc3e0;
  --sky: #6ea8d6;
  --peach: #f1ddd6;
  --peach-deep: #e2c2b4;
  --clay: #c0795c;           /* warm accent for links/CTAs */
  --clay-ink: #9c5638;
  --warm-gray: #c9c2b6;

  --rule: #1d1c1a;
  --max: 1140px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: "Lora", Georgia, serif;
  color: var(--ink);
  background-color: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Type roles ---------- */
.display { font-family: "Playfair Display", Georgia, serif; font-weight: 700; line-height: 1.05; letter-spacing: -0.01em; }
.hand { font-family: "Caveat", cursive; font-weight: 600; }
.eyebrow {
  font-family: "Caveat", cursive; font-size: 23px; font-weight: 700; letter-spacing: 0.01em;
  color: var(--clay-ink); transform: rotate(-1.2deg); display: inline-block;
}

a { color: var(--clay-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--clay); }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 32px; }
.narrow { max-width: 740px; margin: 0 auto; padding: 0 32px; }

.rule-hand {
  border: 0; height: 6px; margin: 0; background: var(--ink);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='6'%3E%3Cpath d='M0 3 Q 60 1 120 3 T 240 3 T 360 3 T 480 3 T 600 3 T 720 3 T 840 3 T 960 3 T 1080 3 T 1200 3' stroke='black' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='6'%3E%3Cpath d='M0 3 Q 60 1 120 3 T 240 3 T 360 3 T 480 3 T 600 3 T 720 3 T 840 3 T 960 3 T 1080 3 T 1200 3' stroke='black' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  -webkit-mask-size: 1200px 6px; mask-size: 1200px 6px;
  -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
}

/* ---------- Navigation ---------- */
.site-nav { position: sticky; top: 0; z-index: 50; background: rgba(253,248,246,0.93); backdrop-filter: blur(8px); border-bottom: 2px solid var(--ink); }
.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { font-family: "Playfair Display", serif; font-weight: 600; font-size: 21px; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand .dot { color: var(--clay); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { font-family: "Lora", serif; font-size: 16px; font-weight: 500; text-decoration: none; color: var(--ink-soft); position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--clay-ink); }
.nav-links a.active::after {
  content:""; position:absolute; left:0; right:0; bottom:-6px; height:5px; background: var(--wash-blue-deep);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='6'%3E%3Cpath d='M2 4 Q 20 1 40 3 T 78 3' stroke='black' stroke-width='3' fill='none'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='6'%3E%3Cpath d='M2 4 Q 20 1 40 3 T 78 3' stroke='black' stroke-width='3' fill='none'/%3E%3C/svg%3E");
  -webkit-mask-size: 80px 6px; mask-size: 80px 6px; -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
}
.nav-toggle { display: none; background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--ink); }

@media (max-width: 780px) {
  .nav-links { position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 2px solid var(--ink); max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
  .nav-links.open { max-height: 460px; }
  .nav-links a { padding: 15px 32px; width: 100%; border-top: 1px solid var(--warm-gray); }
  .nav-links a.active::after { display: none; }
  .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero { padding: 70px 0 0; position: relative; }
.hero h1 { font-size: clamp(40px, 6.4vw, 76px); }
.hero h1 .scribble { position: relative; white-space: nowrap; }
.hero h1 .scribble::after {
  content:""; position:absolute; left:-2%; right:-2%; bottom:2px; height:0.5em; z-index:-1;
  background: var(--wash-blue); opacity: 0.85; border-radius: 40% 60% 55% 45%; transform: rotate(-0.8deg);
}
.hero .lede { font-family: "Lora", serif; font-size: clamp(19px, 2.3vw, 24px); color: var(--ink-soft); max-width: 640px; margin-top: 28px; }
.hero .kicker { margin-bottom: 16px; }

.skyline { width: 100%; display: block; margin-top: 56px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); background: #fffcfb; }
.skyline img { width: 100%; height: auto; display: block; mix-blend-mode: multiply; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: "Playfair Display", serif; font-size: 16px; font-weight: 600;
  text-decoration: none; cursor: pointer; padding: 13px 28px; color: var(--paper);
  background: var(--ink); border: 2px solid var(--ink);
  border-radius: 14px 10px 16px 8px / 8px 16px 9px 15px;
  transition: transform 0.12s, background 0.2s;
}
.btn:hover { background: var(--clay-ink); border-color: var(--clay-ink); color: #fff; transform: translateY(-2px) rotate(-0.5deg); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 36px; }

/* ---------- Sections ---------- */
.section { padding: 78px 0; }
.section h2 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 10px; }
.section .sub { font-size: 19px; color: var(--ink-soft); margin-bottom: 42px; max-width: 640px; }

/* ---------- Stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
@media (max-width:640px){ .stat-row { grid-template-columns:1fr; gap:18px; } }
.stat { background: #fff; border: 2px solid var(--ink); padding: 26px 24px; border-radius: 16px 10px 18px 9px / 9px 18px 10px 16px; position: relative; }
.stat:nth-child(1){ background: var(--wash-blue); }
.stat:nth-child(2){ background: var(--peach); }
.stat:nth-child(3){ background: var(--paper-2); }
.stat .n { font-family:"Playfair Display",serif; font-size: 40px; font-weight: 600; line-height:1.05; }
.stat .l { font-family:"Caveat",cursive; font-size: 19px; color: var(--ink); margin-top:6px; }

/* ---------- Split feature ---------- */
.split { display:grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items:center; }
@media (max-width:820px){ .split { grid-template-columns:1fr; gap:32px; } }
.split p { color: var(--ink-soft); margin-bottom: 16px; }

/* ---------- Framed figures ---------- */
figure { margin: 0; }
.frame { background: #fff; padding: 12px; border: 2px solid var(--ink); border-radius: 6px; box-shadow: 4px 5px 0 rgba(29,28,26,0.9); transform: rotate(-1deg); }
.frame.r { transform: rotate(1.2deg); }
.frame img { width:100%; height:auto; display:block; }
figcaption { font-family:"Caveat",cursive; font-size:19px; color:var(--ink-soft); margin-top:12px; text-align:center; }

/* ---------- Philosophy band ---------- */
.band { background: var(--ink); color: var(--paper); }
.band .eyebrow { color: var(--wash-blue); }
.band a { color: var(--wash-blue); }
.pull { font-family: "Playfair Display", serif; font-size: clamp(24px, 3.4vw, 38px); line-height: 1.32; font-weight: 500; max-width: 880px; }
.pull em { font-style: italic; color: var(--wash-blue-deep); }

/* ---------- Projects ---------- */
.proj-grid { display:grid; grid-template-columns: repeat(2,1fr); gap: 26px; }
@media (max-width:780px){ .proj-grid { grid-template-columns:1fr; } }
.proj { background:#fff; border:2px solid var(--ink); padding: 30px 28px; text-decoration:none; color:var(--ink); display:block; position:relative; border-radius: 18px 10px 20px 9px / 9px 20px 10px 18px; transition: transform 0.14s, box-shadow 0.14s; }
.proj:hover { transform: translateY(-3px) rotate(-0.4deg); box-shadow: 5px 6px 0 var(--wash-blue-deep); color:var(--ink); }
.proj:nth-child(2):hover { box-shadow: 5px 6px 0 var(--peach-deep); }
.proj:nth-child(3):hover { box-shadow: 5px 6px 0 var(--warm-gray); }
.proj:nth-child(4):hover { box-shadow: 5px 6px 0 var(--wash-blue-deep); }
.proj .tagnum { font-family:"Caveat",cursive; font-size: 20px; color: var(--clay-ink); }
.proj h3 { font-family:"Playfair Display",serif; font-size: 26px; margin: 8px 0 10px; }
.proj p { color: var(--ink-soft); font-size: 16.5px; }
.proj .arrow { font-family:"Caveat",cursive; font-size:19px; color: var(--clay); font-weight:700; margin-top:12px; display:inline-block; }

/* ---------- Selected work (portfolio list) ---------- */
.work-grid { display:grid; grid-template-columns: repeat(2,1fr); gap:16px; }
@media (max-width:760px){ .work-grid { grid-template-columns:1fr; } }
.work {
  display:flex; gap:16px; align-items:baseline; text-decoration:none; color:var(--ink);
  background:#fff; border:2px solid var(--ink); padding:18px 22px;
  border-radius: 14px 9px 16px 8px / 8px 16px 9px 14px;
  transition: transform 0.12s, box-shadow 0.12s;
}
.work:hover { transform: translateY(-2px); box-shadow: 4px 5px 0 var(--peach-deep); color:var(--ink); }
.work .yr { font-family:"Caveat",cursive; font-size:18px; font-weight:700; color:var(--clay-ink); white-space:nowrap; flex-shrink:0; min-width:42px; }
.work .meat h4 { font-family:"Playfair Display",serif; font-size:18px; line-height:1.25; margin-bottom:3px; }
.work .meat p { font-family:"Lora",serif; font-size:14.5px; color:var(--ink-soft); line-height:1.45; }
.work .meat .kind { font-family:"Caveat",cursive; font-size:16px; color:var(--clay); }

/* ---------- Post-it note motif ---------- */
.postit {
  display:inline-block; position:relative;
  background: var(--wash-blue);
  color: var(--ink);
  font-family:"Caveat",cursive; font-weight:600; font-size:20px; line-height:1.25;
  padding:16px 20px 18px; max-width:230px;
  box-shadow: 3px 4px 9px rgba(29,28,26,0.16);
  transform: rotate(-2.4deg);
}
.postit::after {  /* subtle gradient like a real sticky's shaded base */
  content:""; position:absolute; left:0; right:0; bottom:0; height:34%;
  background: linear-gradient(transparent, rgba(110,168,214,0.28));
  pointer-events:none;
}
.postit::before { /* tape strip */
  content:""; position:absolute; top:-9px; left:50%; transform:translateX(-50%) rotate(1.5deg);
  width:54px; height:17px; background:rgba(255,255,255,0.45);
  border-left:1px dashed rgba(29,28,26,0.12); border-right:1px dashed rgba(29,28,26,0.12);
}
.postit.r { transform: rotate(2deg); }
.postit.flat { transform: rotate(-0.8deg); }
.postit .pin-label { display:block; font-size:14px; letter-spacing:0.06em; text-transform:uppercase; color:var(--clay-ink); font-family:"Caveat",cursive; font-weight:700; }

/* a sticky that frames a small image */
.postit-img { padding:12px 12px 16px; max-width:210px; }
.postit-img img { display:block; width:100%; height:auto; }
.postit-img::after { display:none; }  /* no shading gradient over a photo */

.postit-cluster {
  position: absolute; top: 0; right: 8px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  max-width: 280px;
}
@media (max-width: 900px) { .postit-cluster { position: static; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; max-width: 100%; } }
.postit-cluster a { text-decoration: none; display: block; }
.postit-cluster a:hover .postit { transform: rotate(-3.5deg) translateY(-3px); box-shadow: 5px 6px 14px rgba(29,28,26,0.22); }
.postit-cluster .postit-label { display: block; font-family: "Caveat", cursive; font-size: 20px; font-weight: 700; color: var(--ink); text-align: center; margin-top: 6px; line-height: 1.2; }


/* ---------- Featured "new" work card ---------- */
.work.featured {
  background: #e7cbc0;
  border-color: var(--ink);
  position: relative;
  overflow: visible;
}
.work.featured:hover { box-shadow: 4px 5px 0 #c0795c; }

.badge-new {
  position: absolute; top: -20px; right: -14px;
  font-family: "Caveat", cursive; font-size: 16px; font-weight: 700;
  color: #fdf8f6;
  background: #c0795c; border: 2px solid var(--ink);
  padding: 4px 11px;
  border-radius: 4px 2px 4px 2px / 2px 4px 2px 4px;
  animation: wobble-badge 2.4s ease-in-out infinite;
  box-shadow: 2px 3px 0 var(--ink);
  white-space: nowrap;
  z-index: 5;
}
@keyframes wobble-badge {
  0%,100% { transform: rotate(-4deg); }
  50%      { transform: rotate(3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .badge-new { animation: none; transform: rotate(-2deg); }
}

/* ---------- Footer ---------- */
.foot { background: var(--ink); color: var(--paper); padding: 64px 0 50px; }
.foot a { color: var(--wash-blue); }
.foot a:hover { color:#fff; }
.foot .cols { display:flex; justify-content:space-between; flex-wrap:wrap; gap:34px; }
.foot h4 { font-family:"Caveat",cursive; font-size:22px; color: var(--wash-blue); margin-bottom:12px; }
.foot .links a { display:block; font-family:"Lora",serif; font-size:16px; margin-bottom:9px; text-decoration:none; }
.foot .tag { max-width: 380px; color:#cfc9bd; }
.foot .fine { margin-top:44px; font-family:"Caveat",cursive; font-size:18px; color:#8a857a; }

/* ---------- Interior page hero ---------- */
.page-hero { padding: 64px 0 0; }
.page-hero h1 { font-size: clamp(34px, 5.4vw, 62px); margin: 16px 0; }
.page-hero .lede { font-size: 20px; color: var(--ink-soft); max-width: 660px; }
.back-link { font-family:"Caveat",cursive; font-size:20px; font-weight:700; text-decoration:none; }

/* ---------- Prose ---------- */
.prose p { margin-bottom: 20px; font-size: 18.5px; }
.prose h3 { font-family:"Playfair Display",serif; font-size: 26px; margin: 40px 0 12px; }
.prose ul { margin: 0 0 20px 22px; }
.prose li { margin-bottom: 9px; font-size: 18.5px; }
.prose em { color: var(--clay-ink); }

/* ---------- Resource cards ---------- */
.res-grid { display:grid; grid-template-columns: repeat(2,1fr); gap:18px; }
@media (max-width:640px){ .res-grid { grid-template-columns:1fr; } }
.res { border:2px solid var(--ink); padding:22px 24px; background:#fff; text-decoration:none; color:var(--ink); display:block; border-radius: 14px 9px 16px 8px / 8px 16px 9px 14px; transition: transform 0.12s, box-shadow 0.12s; }
.res:hover { transform: translateY(-2px); box-shadow: 4px 5px 0 var(--wash-blue-deep); color:var(--ink); }
.res h4 { font-family:"Playfair Display",serif; font-size:19px; margin-bottom:6px; }
.res p { font-family:"Lora",serif; font-size:15.5px; color:var(--ink-soft); }

/* ---------- Coffee page ---------- */
.filter-bar { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:40px; }
.chip { font-family:"Caveat",cursive; font-size:19px; font-weight:600; padding:5px 18px; cursor:pointer; border:2px solid var(--ink); background:#fff; color:var(--ink-soft); border-radius: 100px 90px 100px 90px / 90px 100px 90px 100px; transition: all 0.15s; }
.chip:hover { background: var(--wash-blue); color:var(--ink); }
.chip.active { background: var(--ink); color: var(--paper); }

.post-grid { display:grid; grid-template-columns: repeat(3,1fr); gap:28px; }
@media (max-width:880px){ .post-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width:560px){ .post-grid { grid-template-columns: 1fr; } }
.card { background:#fff; border:2px solid var(--ink); overflow:hidden; cursor:pointer; display:flex; flex-direction:column; border-radius: 16px 10px 18px 9px / 9px 18px 10px 16px; transition: transform 0.16s, box-shadow 0.16s; }
.card:hover { transform: translateY(-4px) rotate(-0.5deg); box-shadow: 5px 6px 0 var(--wash-blue-deep); }
.card .thumb { width:100%; aspect-ratio:4/3; object-fit:cover; background:var(--peach); display:block; border-bottom:2px solid var(--ink); }
.card .body { padding:16px 18px; flex:1; display:flex; flex-direction:column; }
.card .cat { font-family:"Caveat",cursive; font-size:17px; font-weight:700; color:var(--clay-ink); margin-bottom:4px; }
.card h3 { font-family:"Playfair Display",serif; font-size:20px; line-height:1.25; margin-bottom:6px; }
.card .date { font-family:"Caveat",cursive; font-size:16px; color:var(--ink-soft); margin-top:auto; padding-top:10px; }

/* ---------- Modal ---------- */
.modal-bg { position:fixed; inset:0; background:rgba(29,28,26,0.62); z-index:200; display:none; align-items:flex-start; justify-content:center; padding:40px 20px; overflow-y:auto; }
.modal-bg.open { display:flex; }
.modal { background:var(--paper); max-width:760px; width:100%; padding:46px 50px; position:relative; margin:auto; border:2px solid var(--ink); border-radius: 10px; box-shadow: 8px 10px 0 rgba(29,28,26,0.9); }
@media (max-width:600px){ .modal { padding:34px 24px; } }
.modal .close { position:absolute; top:16px; right:20px; background:none; border:0; font-size:30px; cursor:pointer; color:var(--ink-soft); line-height:1; }
.modal .close:hover { color:var(--clay); }
.modal .cat { color:var(--clay-ink); }
.modal h2 { font-family:"Playfair Display",serif; font-size:32px; margin:8px 0 6px; line-height:1.1; }
.modal .date { font-family:"Caveat",cursive; font-size:18px; color:var(--ink-soft); margin-bottom:24px; }
.modal img { width:100%; height:auto; border:2px solid var(--ink); border-radius:4px; margin:20px 0; }
.modal p { font-size:17.5px; margin-bottom:16px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .frame, .frame.r, .btn, .proj, .card, .chip { transform: none !important; }
}
