/* ==========================================================================
   noahstetson.com — all of the site's styling lives in this one file.

   QUICK EDITS
   -----------
   Change the font ........ section 1 (two steps, explained there)
   Change the colors ...... section 2
   Change sizes/spacing ... section 3
   Playful extras ......... menu dogs + blue stripe are in section 6,
                            breed labels + paw prints are in section 13

   CONTENTS
   --------
    1. Fonts
    2. Colors
    3. Sizes
    4. Basics (page, links)
    5. Layout helper (.wrap)
    6. Header and menu
    7. Headings and text
    8. Home page
    9. Research and Outreach entries, photo galleries
   10. Click-to-enlarge photo viewer
   11. CV page
   12. "Page not found" page
   13. Footer (dog strip, breed labels, paw prints)
   14. Phone and tablet adjustments
   15. Printing
   ========================================================================== */


/* ==========================================================================
   1. FONTS

   To change the font, do both steps:

   Step 1. Load the font by replacing the @import line below.
     - Google Fonts: pick a font at fonts.google.com, choose "Get embed
       code", then "@import", and paste the @import line here.
     - Adobe Fonts: at fonts.adobe.com add the font to a "Web Project".
       Adobe gives you a link like https://use.typekit.net/abc1234.css
       Use it like this:   @import url("https://use.typekit.net/abc1234.css");
     The site uses three weights: 400 (regular), 600 (semibold), 700 (bold),
     plus 400 italic. Include those when you pick weights.

   Step 2. Put the font's name in --font (and --font-heading) just below.
     Adobe shows the exact name to use under "font-family" in the Web Project.
     Google Fonts uses the family name with spaces, e.g. "Atkinson Hyperlegible Next".
     The name must match exactly, or the browser silently uses Helvetica.
   ========================================================================== */
 
@import url("https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:ital,wght@0,400;0,600;0,700;1,400&display=swap");  /* Atkinson Hyperlegible Next */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");  /* Inter (headings) */

:root {
  
  /* Body text. The names after the first are fallbacks if it fails to load. */
  --font: "Atkinson Hyperlegible Next", "Helvetica Neue", "Helvetica", "Arial", sans-serif;

  /* Headings and the "Noah Stetson" name in the header.
  To have same as the body font, use var(--font)
  To have it be different, put the name, e.g. --font-heading: "freight-text-pro", Georgia, serif; */
  --font-heading: "Inter", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  

 /* Links to other fonts I could use
@import url ("https://use.typekit.net/ffe6rtc.css"); garamond-atf-subhead
 
 @import url("https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:ital,wght@0,400;0,600;0,700;1,400&display=swap");  atkinson-hyperlegible-next
 
 @import url("https://use.typekit.net/ffe6rtc.css");  sorts-mill-goudy
 
 "Helvetica Neue" (doesn't need link)
 
 */

/* ==========================================================================
   2. COLORS
   Change a value here and it updates everywhere on the site.
   ========================================================================== */

  --bg: #ffffff;          /* page background */
  --bg-soft: #f5f5f4;     /* light gray: menu hover, photo placeholders */
  --ink: #161616;         /* headings, near-black */
  --text: #333333;        /* body text */
  --muted: #6b6b6b;       /* quieter gray text: subtitles, footer */
  --rule: #e4e4e4;        /* thin gray divider lines */

  --accent: #007BA7;      /* the blue: header stripe, current menu tab, paw prints */
  --link: #007BA7;        /* link text and buttons */
  --link-hover: #005F82;  /* links and buttons when the mouse is over them */
  /* If you change the blue, keep it dark enough that white text on it and
     blue text on white are both easy to read. */

/* Alt colors I like
Green: #009F6B
Blue: #007BA7
Blue for link hover: #005F82
*/

/* ==========================================================================
   3. SIZES
   ========================================================================== */

  --wrap: 1040px;         /* widest the page content gets */
  --read: 700px;          /* widest a paragraph gets (comfortable line length) */
  --gutter: clamp(16px, 4vw, 40px);  /* space at the left/right screen edges */

  --stripe: 4px;          /* thickness of the blue stripe under the menu */
  --nav-dog: 30px;        /* height of the little dogs above the menu
                             (set to 0px to hide them) */

  color-scheme: light;    /* the site is light-mode only */
}


/* ==========================================================================
   4. BASICS
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;        /* base text size */
  line-height: 1.65;      /* space between lines of text */
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--link-hover); }

/* Outline shown when moving through the page with the keyboard */
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* "Skip to content" link: hidden until a keyboard user tabs to it */
.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: 8px 14px; z-index: 10;
}
.skip:focus { left: 12px; top: 12px; }


/* ==========================================================================
   5. LAYOUT HELPER
   .wrap centers content and keeps it from getting too wide.
   ========================================================================== */

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}


/* ==========================================================================
   6. HEADER AND MENU
   The menu items are tabs that sit on a stripe. The tab for the
   page you are on is filled blue. A small dog stands on top of each tab.
   ========================================================================== */

.site-header { border-bottom: var(--stripe) solid var(--accent); }
.site-header .wrap {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 14px;
}

/* "Noah Stetson" at the top left */
.wordmark {
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: 8px;
}
.wordmark:hover { color: var(--ink); }

/* Menu tabs */
.nav { display: flex; gap: 4px; }
.nav a {
  position: relative;
  margin-top: calc(var(--nav-dog) + 2px);  /* leaves room for the dog */
  padding: 7px 16px 8px;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
}
.nav a:hover { color: var(--ink); background: var(--bg-soft); }

/* The tab for the page you are on. Each page's HTML marks its own menu link
   with aria-current="page". */
.nav a[aria-current="page"],
.nav a[aria-current="page"]:hover { background: var(--accent); color: #fff; }

/* Menu dogs. One image per tab, in menu order. To swap a dog, replace its
   image file in assets/img/ (keep the filename), or point to another file
   here. To remove the dogs, set --nav-dog to 0px in section 3. */
.nav a::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: var(--nav-dog);
  background: center bottom / contain no-repeat;
  transition: transform 0.15s ease;
}
.nav a:nth-child(1)::before { background-image: url("../img/nav-dog-about.png"); }     /* About: Border Collie */
.nav a:nth-child(2)::before { background-image: url("../img/nav-dog-research.png"); }  /* Research: Pointer */
.nav a:nth-child(3)::before { background-image: url("../img/nav-dog-outreach.png"); }  /* Outreach: Great Dane */
.nav a:nth-child(4)::before { background-image: url("../img/nav-dog-cv.png"); }        /* CV: Wire Fox Terrier */

/* The dog hops a little when you point at its tab */
.nav a:hover::before { transform: translateY(-3px); }


/* ==========================================================================
   7. HEADINGS AND TEXT
   ========================================================================== */

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}
h1 { font-size: clamp(36px, 5vw, 50px); letter-spacing: -0.02em; }  /* page titles */
h2 { font-size: 25px; letter-spacing: -0.01em; }                    /* section titles */
h3 { font-size: 23px; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

/* Gray line under a page title, e.g. "PhD Student, University of Arizona" */
.subtitle {
  font-size: 20px;
  color: var(--muted);
  margin: 12px 0 0;
}

/* Title area at the top of Research, Outreach, CV */
.page-head {
  padding-top: clamp(44px, 7vw, 80px);
  padding-bottom: clamp(28px, 4vw, 44px);
}


/* ==========================================================================
   8. HOME PAGE
   ========================================================================== */

/* Top of the home page: text on the left, photo on the right */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
  padding: clamp(48px, 8vw, 96px) 0;
}
.hero h1 { margin-bottom: 6px; }
.hero .subtitle { margin: 0 0 28px; }
.hero .intro {
  font-size: 21px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 24px;
}
.portrait { margin: 0; }
.portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;          /* shape of the photo crop */
  object-fit: cover;
  object-position: 52% 30%;     /* which part of the photo stays in view */
}

/* Row of profile links with icons (Google Scholar, ORCID, ...) */
.profiles {
  list-style: none;
  margin: 28px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
}
.profiles a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
}
.profiles svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: none;
}
.profiles a:hover { color: var(--accent); }
.profiles a:hover span { text-decoration: underline; text-underline-offset: 3px; }

/* "About" section: heading on the left, paragraphs on the right */
.section {
  border-top: 1px solid var(--rule);
  padding: clamp(40px, 6vw, 64px) 0;
}
.section-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(20px, 5vw, 56px);
}
.section-grid > h2 { padding-top: 2px; }
.prose { max-width: var(--read); }


/* ==========================================================================
   9. RESEARCH AND OUTREACH ENTRIES, PHOTO GALLERIES
   ========================================================================== */

/* One entry = a heading, some text, and optionally a photo gallery */
.entry:first-child { border-top: 1px solid var(--rule); }
.entry {
  padding: clamp(32px, 5vw, 48px) 0;
  border-bottom: 1px solid var(--rule);
}
.entry h2 { margin-bottom: 12px; }
.entry .text { max-width: var(--read); }

/* Gallery: rows of photos at their natural shapes, no cropping.
   Each photo's link sets --r (its width ÷ height) in the HTML.
   --h is roughly how tall each row of photos is. */
.gallery {
  --h: 190px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.gallery::after { content: ""; flex-grow: 1000000; }
.gallery a {
  flex-grow: calc(var(--r) * 100);
  flex-basis: calc(var(--r) * var(--h));
  aspect-ratio: var(--r);
  background: var(--bg-soft);
  overflow: hidden;
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.15s ease;
}
.gallery a:hover img { opacity: 0.88; }
.gallery.large { --h: 300px; }   /* class="gallery large" makes bigger photos */


/* ==========================================================================
   10. CLICK-TO-ENLARGE PHOTO VIEWER
   (the behavior is in assets/js/site.js)
   ========================================================================== */

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
}
.lightbox::backdrop { background: rgba(10, 10, 10, 0.92); }
.lightbox-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 72px;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}
.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: #fff;
  font: 400 30px/1 var(--font);
  padding: 14px 18px;
  cursor: pointer;
  opacity: 0.75;
}
.lightbox button:hover { opacity: 1; }
.lightbox button:focus-visible { outline-color: #fff; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }


/* ==========================================================================
   11. CV PAGE
   ========================================================================== */

.cv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* Buttons ("Download PDF", "Open in new tab") */
.button {
  display: inline-block;
  font-size: 17px;
  font-weight: 600;
  padding: 10px 20px;
  border: 1px solid var(--link);
  background: var(--link);
  color: #fff;
  text-decoration: none;
}
.button:hover { background: var(--link-hover); border-color: var(--link-hover); color: #fff; }
.button.secondary { background: #fff; color: var(--link); }
.button.secondary:hover { background: var(--bg-soft); color: var(--link-hover); }

/* The embedded PDF */
.cv-frame {
  width: 100%;
  height: 85vh;
  min-height: 560px;
  border: 1px solid var(--rule);
  background: var(--bg-soft);
}


/* ==========================================================================
   12. "PAGE NOT FOUND" PAGE (404.html)
   Photo of Honor next to the message.
   ========================================================================== */

.oops {
  display: flex;
  align-items: center;
  gap: clamp(20px, 5vw, 48px);
}
.oops img { width: 180px; flex: none; }


/* ==========================================================================
   13. FOOTER
   ========================================================================== */

/* The row of dogs. The dogs themselves are listed in assets/js/site.js,
   which places one picture per dog in this row and repeats the set to fill
   the screen. Change the two numbers in clamp() on the "height" line to make
   the whole row smaller/larger. */
.engraving-band {
  height: clamp(90px, 11vw, 130px);
  margin-top: clamp(56px, 8vw, 96px);
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;                /* dogs stand on the bottom edge */
  gap: clamp(12px, 2vw, 26px);          /* space between dogs */
  padding-left: clamp(6px, 1vw, 14px);
  overflow: hidden;
}
.footer-dog {
  flex: none;
  width: auto;
  max-width: none;
  cursor: pointer;
}

/* Name label that pops up over a dog. Styled like an old Windows tooltip. */
.breed-tip {
  position: fixed;
  z-index: 40;
  transform: translate(-50%, -100%);
  background: #ffffe1;
  color: #000;
  border: 1px solid #000;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25);
  font-size: 14px;
  line-height: 1.3;
  padding: 2px 8px;
  white-space: nowrap;
  pointer-events: none;
}
.breed-tip[hidden] { display: none; }

/* Paw prints that walk away when you click a dog */
.paw-print {
  position: fixed;
  z-index: 50;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  color: var(--accent);       /* paw print color */
  pointer-events: none;
  opacity: 0;
  animation: paw-fade 2s ease-out forwards;   /* how long each print stays */
}
.paw-print svg { width: 100%; height: 100%; fill: currentColor; display: block; }
@keyframes paw-fade {
  0%   { opacity: 0; }
  8%   { opacity: 0.85; }
  60%  { opacity: 0.85; }
  100% { opacity: 0; }
}

/* Copyright line and links at the very bottom */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 32px 0 44px;
  font-size: 16px;
  color: var(--muted);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 40px;
}
.site-footer a { color: var(--text); }
.site-footer a:hover { color: var(--ink); }
.links-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}


/* ==========================================================================
   14. PHONE AND TABLET ADJUSTMENTS
   Rules inside each block only apply when the screen is narrower than the
   width given.
   ========================================================================== */

/* Tablets and narrower: stack side-by-side layouts */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .portrait { max-width: 420px; order: -1; }
  .section-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* Phones */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 0; }
  .wordmark { padding-bottom: 0; }
  .nav { gap: 2px; margin-left: -10px; }
  .nav a { padding: 6px 10px 7px; }
  .gallery { --h: 120px; gap: 6px; }
  .gallery.large { --h: 180px; }
  .lightbox-inner { padding: 56px 8px; }
  .lb-prev, .lb-next { top: auto; bottom: 4px; transform: none; }
  .cv-frame { display: none; }   /* phones can't show the PDF inline; the buttons remain */
  .oops { flex-direction: column; align-items: flex-start; }
  .oops img { width: 140px; }
}


/* ==========================================================================
   15. PRINTING
   ========================================================================== */

@media print {
  .nav, .engraving-band, .cv-frame, .gallery { display: none; }
}
