/* =========================================================
   Karin Yamakawa — site styles
   Layout rule: every container is a flex box (= Figma Auto Layout).
   No absolute positioning, no grid, no percentage widths.
   ========================================================= */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face { font-family: "Libre Baskerville"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/libre-baskerville-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Libre Baskerville"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/libre-baskerville-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Libre Baskerville"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../assets/fonts/libre-baskerville-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/inter-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../assets/fonts/inter-latin-700-normal.woff2") format("woff2"); }

/* ---------- Design tokens (mirror these as Figma Variables) ---------- */
:root {
  --color-bg: #fbfaf8;
  --color-text: rgba(41, 39, 39, 0.86);
  --color-text-strong: rgba(41, 39, 39, 0.9);
  --color-tagline: rgba(27, 26, 26, 0.86);
  --color-link: rgb(41, 39, 39);
  --color-rule: rgba(0, 0, 0, 0.08);
  --color-hero: #474545;          /* dark header on project pages */

  --font-serif: "Libre Baskerville", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --nav-height: 60px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
}
h1, h2, p, ul { margin: 0; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* =========================================================
   Site nav (About / Works pages; home page on small screens)
   ========================================================= */
.site-nav {
  position: sticky;              /* stays on top while scrolling */
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-height);
  padding: 10px 20px 10px 30px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-rule);
}
.site-nav__name {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1.2;
  color: var(--color-text);
  white-space: nowrap;
}
.site-nav__links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
}
.site-nav__links a {
  display: flex;
  padding: 8px;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1;
  color: var(--color-link);
}

/* Mobile menu: a native <details> toggle, no JavaScript */
.site-nav__menu { display: none; }
.site-nav__menu summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 4px;
  cursor: pointer;
  list-style: none;
}
.site-nav__menu summary::-webkit-details-marker { display: none; }
.site-nav__menu summary span {
  display: flex;
  width: 32px;
  height: 2px;
  background: rgba(41, 39, 39, 0.5);
}
.site-nav__menu-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 0 12px;
}
.site-nav__menu-links a {
  display: flex;
  padding: 8px 4px;
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--color-link);
}

/* Home page: the nav only exists on small screens */
.site-nav--home { display: none; }

/* =========================================================
   Home page
   ========================================================= */
.home {
  display: flex;
  flex-direction: row;
  flex: 1 1 0;                  /* fill the viewport height */
  align-self: center;           /* centered ...                 */
  width: 100%;                  /* ... Fill width ...           */
  max-width: 1200px;            /* ... up to 1200px, like Framer */
  min-height: 100vh;
  padding: 0 0 0 104px;
}
.home__intro {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;                  /* Fill width */
}
.home__tagline-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 0;                  /* Fill height: centers the tagline */
  padding-top: 90px;            /* balances the name below, so the tagline sits mid-window */
}
.home__tagline {
  max-width: 444px;
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.2;
  color: var(--color-tagline);
}
.home__name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 54px;
  line-height: 1.2;
  color: var(--color-text-strong);
  padding-bottom: 40px;
}
.home__links {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 67px;
  width: 480px;                 /* Fixed */
  padding-top: 30vh;            /* sits in the lower part of the page */
}
.home__links a {
  display: flex;
  padding: 8px 6px;
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1;
  color: var(--color-link);
}

/* =========================================================
   Content pages (About me, Works, projects)
   Values taken from the Framer site's own CSS.
   ========================================================= */
.page {
  display: flex;
  flex-direction: column;
  align-self: center;           /* centered column ...            */
  width: 100%;                  /* ... Fill width ...             */
  max-width: 1364px;            /* ... capped on very wide screens */
  padding: 103px 117px 50px;
}
.page-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 50px;
  line-height: 60px;
  color: var(--color-text);
}

/* A section: heading + body, 48px apart, 48px above and below */
.block {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding: 48px 0;
}
.block--intro {                 /* page title + intro paragraphs */
  gap: 77px;
  padding: 0 0 60px;
}
.block-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 17px;
}
.block-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 48px;
  color: var(--color-text);
}
.block-subtitle {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 24px;
  color: var(--color-text);
}

/* Body copy: indented column of paragraph groups */
.prose {
  display: flex;
  flex-direction: column;
  gap: 56px;                    /* = one blank line between groups */
  max-width: 1007px;            /* 120px indent + 887px text */
  padding-left: 120px;
}
.prose__group {
  display: flex;
  flex-direction: column;
  gap: 12px;                    /* paragraph spacing */
}
.prose p, .prose li {
  font-family: var(--font-sans);
  font-size: 22px;
  line-height: 32px;
  color: var(--color-text);
}
.prose ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 1.2em;
}

/* Milestones: one row per year */
.milestones {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1007px;
  padding: 0 0 8px 120px;
  list-style: none;
}
.milestone {
  display: flex;
  flex-direction: row;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 22px;
  line-height: 32px;
  color: var(--color-text);
}
.milestone__year {
  flex: 0 0 auto;
  width: 234px;                 /* Fixed */
  font-weight: 700;
}
.milestone__event { flex: 1 1 0; }  /* Fill */

/* =========================================================
   Works page
   ========================================================= */
.works {
  display: flex;
  flex-direction: column;
  align-self: center;
  width: 100%;                  /* Fill width ... */
  max-width: 1364px;            /* ... capped on very wide screens */
  padding: 0 0 200px;
}
.works__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 225px 24px 142px;
}
.works__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 96px;
  line-height: 1;
  color: var(--color-text);
}

/* One project: text column + image */
.project {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 64px;
  padding: 64px 0 64px 64px;
}
.project__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 25px;
  flex: 0 0 auto;
  width: 460px;                 /* Fixed */
  padding: 25px 13px 25px 0;
}
.project__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.3;
  color: var(--color-text);
}
.project__desc {
  max-width: 299px;
  min-height: 150px;
  padding-left: 3px;
  font-family: var(--font-sans);
  font-size: 22px;
  line-height: 32px;
  color: var(--color-text);
}
.project__more {
  display: flex;
  padding: 8px 6px;
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1;
  color: var(--color-link);
}
.project__media {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  flex: 1 1 0;                  /* Fill */
  min-width: 0;
}
.project__img {
  display: block;
  flex: 1 1 0;                  /* Fill, height follows the image */
  min-width: 0;
  max-width: 693px;
  height: auto;
}
.project__media--small .project__img { max-width: 471px; }

/* Wide image: goes under the text instead of beside it */
.project--stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding-right: 64px;
}
.project--stacked .project__media { justify-content: flex-end; }
.project--stacked .project__img { max-width: 1087px; }

/* =========================================================
   Project pages (projects/*.html)
   ========================================================= */
.case {
  display: flex;
  flex-direction: column;
}
.case__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
  padding: 200px 40px 100px;
  background: var(--color-hero);
  color: var(--color-bg);
}
.case__titles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 31px;
}
.case__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 96px;
  line-height: 1;
  text-align: center;
}
.case__date {
  font-family: var(--font-sans);
  font-size: 25px;
  line-height: 1.2;
  text-align: center;
}
.case__lead {
  width: 100%;                  /* Fill ...      */
  max-width: 660px;             /* ... up to 660 */
  font-family: var(--font-sans);
  font-size: 28px;
  line-height: 1.2;
}

/* Write-up */
.case__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 112px;                   /* between sections */
  padding: 88px 24px 100px;
}
.case__section {
  display: flex;
  flex-direction: column;
  gap: 48px;                    /* heading to content */
  width: 100%;                  /* Fill ...      */
  max-width: 840px;             /* ... up to 840 */
}
.case__heading {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.3;
  color: var(--color-text);
}
.case__content {
  display: flex;
  flex-direction: column;
  gap: 32px;                    /* paragraph spacing */
}
.case__group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.case__content p, .case__content li {
  font-family: var(--font-sans);
  font-size: 22px;
  line-height: 32px;
  color: var(--color-text);
}
.case__content ul {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding-left: 1.2em;
}
.case__img {
  display: block;
  align-self: stretch;          /* Fill width, height follows the image */
  max-width: 100%;
  height: auto;
}
.case__img--narrow {             /* portrait sketches: shown at half size */
  align-self: flex-start;
  width: 100%;
  max-width: 504px;
}
.case__subheading {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.4;
  color: #333333;
}
.case__content a {
  text-decoration: underline;
  overflow-wrap: anywhere;      /* long DOI links wrap on phones */
}

/* =========================================================
   Small screens: one breakpoint, same as the Framer site (1199px)
   ========================================================= */
@media (max-width: 1199px) {
  /* nav */
  .site-nav { padding: 10px 16px; }
  .site-nav__name { font-size: 26px; }
  .site-nav__links { display: none; }
  .site-nav__menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }
  .site-nav--home { display: flex; }

  /* home */
  .home {
    flex-direction: column;
    gap: 24px;
    min-height: 0;
    padding: 70px 35px 35px;
  }
  .home__intro { flex: 0 0 auto; gap: 24px; }
  .home__tagline-wrap { flex: 0 0 auto; padding-top: 0; }
  .home__name {
    order: -1;                  /* name above tagline on small screens */
    max-width: 450px;
    font-size: 56px;
    line-height: 1.1;
    padding-bottom: 0;
  }
  .home__tagline { max-width: 450px; font-size: 20px; line-height: 1.2; }
  .home__links { display: none; }

  /* content pages */
  .page { max-width: none; padding: 0 48px 24px; }
  .block { gap: 24px; padding: 36px 0; }
  .block--intro { gap: 48px; padding: 72px 0 48px; }
  .block-head { padding-left: 0; }
  .block-subtitle { display: none; }
  .prose, .milestones { max-width: none; padding-left: 0; }
  .milestone { flex-direction: column; gap: 6px; }
  .milestone__year { width: auto; }

  /* works */
  .works { padding: 0 0 96px; }
  .works__hero { padding: 96px 24px 48px; }
  .works__title { font-size: 64px; }
  .project, .project--stacked {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding: 32px 24px;
  }
  .project__text { width: auto; padding: 0; }
  .project__desc { max-width: none; min-height: 0; padding-left: 0; }
  .project__img,
  .project__media--small .project__img,
  .project--stacked .project__img { max-width: none; }

  /* project pages */
  .case__hero { gap: 40px; padding: 96px 24px 64px; }
  .case__titles { gap: 16px; }
  .case__title { font-size: 64px; }
  .case__date { font-size: 20px; }
  .case__lead { font-size: 22px; line-height: 1.3; }
  .case__body { gap: 72px; padding: 56px 24px 72px; }
  .case__section { gap: 28px; }
  .case__heading { font-size: 32px; }
  .case__content p, .case__content li { font-size: 18px; line-height: 28px; }
}
