/* =========================================================================
   yohtarojs.com — styles
   Clean, white, Roboto Mono.
   To recolour the whole site, change the few values under ":root" below.
   ========================================================================= */

/* ---- the font (self-hosted, lives in /fonts) ---------------------------- */
@font-face{
  font-family:"Roboto Mono"; font-weight:400; font-style:normal; font-display:swap;
  src:url("fonts/RobotoMono-400.woff2") format("woff2");
}
@font-face{
  font-family:"Roboto Mono"; font-weight:700; font-style:normal; font-display:swap;
  src:url("fonts/RobotoMono-700.woff2") format("woff2");
}
@font-face{
  font-family:"Roboto Mono"; font-weight:400; font-style:italic; font-display:swap;
  src:url("fonts/RobotoMono-400italic.woff2") format("woff2");
}

:root{
  /* colour ------------------------------------------------------------ */
  --bg:     #ffffff;   /* white                               */
  --panel:  #f4f3f1;   /* light grey for cards / code         */
  --ink:    #1c1b1a;   /* main text                           */
  --muted:  #6a6760;   /* secondary text                      */
  --faint:  #9a958c;   /* captions, small labels              */
  --line:   rgba(0,0,0,.12);      /* hairlines / rules        */
  --accent: #c23a20;   /* accent — links, marks               */

  /* type -------------------------------------------------------------- */
  --mono: "Roboto Mono", ui-monospace, "Courier New", monospace;

  /* size -------------------------------------------------------------- */
  --measure: 42rem;    /* reading width        */
  --page:    58rem;    /* page column width    */
  --pad:     clamp(1.25rem, 5vw, 2.75rem);
}

/* ---- base --------------------------------------------------------------- */
*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--mono);
  font-weight:400;
  font-size:clamp(.9rem,.7rem + .7vw,1rem);
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
}

img{ max-width:100%; height:auto; display:block; }
a{ color:var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; text-underline-offset:3px; }
strong,b{ font-weight:700; }

/* ---- opening animation: a clean fade-in --------------------------------- */
@keyframes boot{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }
.page{ animation:boot .5s ease-out both; }
@media (prefers-reduced-motion:reduce){ .page{ animation:none; } }

/* blinking terminal caret */
.caret{
  display:inline-block; width:.6em; height:1em; vertical-align:-.12em;
  background:var(--accent); margin-left:.25em;
  animation:blink 1.1s steps(1) infinite;
}
@keyframes blink{ 50%{ opacity:0; } }
@media (prefers-reduced-motion:reduce){ .caret{ animation:none; } }

/* ---- shared column ------------------------------------------------------ */
.page{ max-width:var(--page); margin-inline:auto; padding-inline:var(--pad); }
.page.wide{ max-width:72rem; }
.col{  max-width:var(--measure); }

/* ---- letterhead (top bar: name + nav + socials) ------------------------ */
.head{
  display:flex; flex-wrap:wrap; align-items:baseline; gap:.6rem 1rem;
  padding:1.4rem 0 1.1rem;
  border-bottom:1px solid var(--line);
}
.head .mark{ font-size:.85rem; font-weight:700; color:var(--ink); }
.head .mark:hover{ color:var(--accent); text-decoration:none; }
.head nav{ margin-left:auto; display:flex; flex-wrap:wrap; align-items:baseline; gap:1.1rem; }
.head nav > a{ font-size:.82rem; color:var(--muted); }
.head nav > a:hover,.head nav > a[aria-current="page"]{ color:var(--ink); text-decoration:none; }
.head nav > a[aria-current="page"]{ text-decoration:underline; text-underline-offset:4px; text-decoration-color:var(--accent); }
.head .social{
  display:inline-flex; flex-wrap:wrap; gap:1.1rem;
  padding-left:1.1rem; border-left:1px solid var(--line);
}
.head .social:empty{ display:none; }
.head .social a{ font-size:.82rem; color:var(--muted); }
.head .social a:hover{ color:var(--accent); text-decoration:none; }

/* ---- masthead (the name + optional ASCII portrait) --------------------- */
.masthead{ padding:clamp(2.2rem,6vw,4rem) 0 1.4rem; }
.masthead.has-ascii{
  display:grid; grid-template-columns:1fr auto;
  gap:clamp(1.2rem,4vw,3rem); align-items:start;
}
.masthead h1{
  margin:0; font-weight:700;
  letter-spacing:-.02em; line-height:1.08;
  font-size:clamp(1.9rem,6vw,3.6rem);
}
.masthead .kanji{ font-size:.95rem; color:var(--muted); margin-top:.9rem; }
.masthead .intro{
  font-size:clamp(1rem,.9rem + .5vw,1.18rem); line-height:1.6;
  max-width:34rem; margin:1.5rem 0 0; color:var(--ink);
}
.masthead .place{ font-size:.82rem; color:var(--muted); margin-top:1.1rem; }
.masthead.rule{ border-bottom:1px solid var(--line); }

/* the ASCII portrait */
.ascii{
  margin:0; white-space:pre; line-height:1;
  font-family:var(--mono);
  font-size:clamp(.42rem,1.1vw,.62rem);
  color:var(--ink); overflow-x:auto;
  align-self:center;
}
@media (max-width:680px){
  .masthead.has-ascii{ grid-template-columns:1fr; }
  .ascii{ order:-1; margin-bottom:1rem; font-size:.6rem; }
}

/* ---- a labelled, ruled list (lived / work / school) -------------------- */
.block{ padding:clamp(1.8rem,5vw,2.6rem) 0; border-bottom:1px solid var(--line); }
.block > .label{ font-size:.74rem; letter-spacing:.06em; color:var(--faint); margin:0 0 1.1rem; text-transform:uppercase; }
.rows{ list-style:none; margin:0; padding:0; }
.rows li{ display:grid; grid-template-columns:10rem 1fr; gap:.2rem 1.5rem; padding:.55rem 0; }
.rows .yr{ font-size:.8rem; color:var(--muted); padding-top:.2rem; }
.rows .tx{ font-size:1.02rem; line-height:1.45; }
@media (max-width:540px){
  .rows li{ grid-template-columns:1fr; gap:.1rem; padding:.7rem 0; }
  .rows .yr{ padding-top:0; }
}

/* skills — same ruled list, wider left column + a bold skill name */
.rows.skillrows li{ grid-template-columns:13rem 1fr; align-items:start; padding:1.2rem 0; border-top:1px solid var(--line); }
.rows.skillrows li:first-child{ border-top:none; padding-top:.2rem; }
.rows.skillrows .sk{ font-weight:700; color:var(--ink); font-size:.95rem; padding-top:.1rem; }
.rows.skillrows .desc{ color:var(--muted); font-size:1rem; line-height:1.6; }
.rows.skillrows .desc .ln{ display:block; }
.rows.skillrows .desc .ln + .ln{ margin-top:.15rem; }
.embed{ margin-top:1rem; }
.embed iframe{ width:100%; max-width:400px; height:720px; border:1px solid var(--line); background:#fff; display:block; }
@media (max-width:600px){
  .rows.skillrows li{ grid-template-columns:1fr; gap:.4rem; padding:1.1rem 0; }
  .rows.skillrows .sk{ padding-top:0; }
}

/* ---- colophon (footer) -------------------------------------------------- */
.foot{ display:flex; flex-wrap:wrap; gap:.8rem 1.6rem; align-items:baseline; padding:1.6rem 0 2.4rem; }
.foot a, .foot span{ font-size:.78rem; color:var(--muted); }
.foot a:hover{ color:var(--accent); text-decoration:none; }
.foot .copy{ margin-left:auto; color:var(--faint); }

/* ---- page intro (blog / photography headers) --------------------------- */
.intro-block{ padding:clamp(2rem,6vw,3.4rem) 0 1.6rem; }
.intro-block .label{ font-size:.74rem; letter-spacing:.06em; color:var(--faint); margin:0 0 .8rem; text-transform:uppercase; }
.intro-block h1{
  margin:0; font-weight:700; letter-spacing:-.02em;
  font-size:clamp(1.8rem,6vw,3rem); line-height:1.08;
}
.intro-block p{ font-size:.86rem; color:var(--muted); margin:1rem 0 0; }

/* ---- writing index ------------------------------------------------------ */
.postlist{ list-style:none; margin:0; padding:0; }
.postlist li{ border-top:1px solid var(--line); }
.postlist a{ display:grid; grid-template-columns:8rem 1fr; gap:.3rem 1.5rem; padding:1.5rem 0; color:var(--ink); }
.postlist a:hover{ text-decoration:none; }
.postlist a:hover h2{ color:var(--accent); }
.postlist .date{ font-size:.78rem; color:var(--muted); padding-top:.35rem; }
.postlist h2{ font-weight:700; font-size:1.3rem; line-height:1.25; margin:0 0 .35rem; transition:color .15s; }
.postlist .excerpt{ font-size:.84rem; color:var(--muted); margin:0; line-height:1.6; }
.postlist .ext{ font-size:.66rem; font-weight:400; color:var(--faint); letter-spacing:.02em; white-space:nowrap; vertical-align:.12em; }
@media (max-width:540px){
  .postlist a{ grid-template-columns:1fr; gap:.15rem; }
  .postlist .date{ padding-top:0; }
}

/* ---- single post -------------------------------------------------------- */
.article-head{ padding:clamp(1rem,4vw,2rem) 0 1.5rem; }
.article-head .date{ font-size:.8rem; color:var(--muted); }
.article-head h1{
  font-weight:700; font-size:clamp(1.8rem,4vw + 1rem,2.8rem); line-height:1.12;
  letter-spacing:-.02em; margin:.5rem 0 0;
}
.prose{ font-size:1rem; line-height:1.8; }
.prose > *:first-child{ margin-top:0; }
.prose p{ margin:0 0 1.3rem; }
.prose h2{ font-weight:700; font-size:1.25rem; margin:2.4rem 0 .8rem; }
.prose h3{ font-weight:700; font-size:1.08rem; margin:2rem 0 .6rem; color:var(--muted); }
.prose a{ text-decoration:underline; text-underline-offset:3px; }
.prose blockquote{ margin:1.6rem 0; padding:.2rem 0 .2rem 1.4rem; border-left:3px solid var(--accent); color:var(--muted); font-style:italic; }
.prose ul,.prose ol{ margin:0 0 1.3rem; padding-left:1.4rem; }
.prose li{ margin:.4rem 0; }
.prose img{ margin:1.8rem 0; border:1px solid var(--line); border-radius:4px; }
.prose hr{ border:none; border-top:1px solid var(--line); margin:2.6rem 0; }
.prose code{ font-size:.92em; background:var(--panel); padding:.08em .35em; border-radius:3px; }
.prose figure{ margin:1.8rem 0; }
.prose figcaption{ font-size:.76rem; color:var(--faint); text-align:center; margin-top:.5rem; }

/* ---- back link ---------------------------------------------------------- */
.back{ font-size:.8rem; color:var(--muted); display:inline-block; margin-top:1.5rem; }
.back:hover{ color:var(--accent); text-decoration:none; }

/* ---- photography gallery (big, captions below) -------------------------- */
.gallery{ display:grid; grid-template-columns:repeat(2,1fr); gap:2.6rem 1.8rem; padding-top:.5rem; }
.gallery figure{ margin:0; }
.gallery .shot{ display:block; }
.gallery img{ width:100%; height:auto; display:block; border:1px solid var(--line); transition:opacity .2s; image-orientation:from-image; }
.gallery .shot:hover img{ opacity:.92; }
.gallery figcaption{ margin-top:.75rem; display:flex; justify-content:space-between; gap:1.2rem; align-items:baseline; font-size:.84rem; line-height:1.45; }
.gallery figcaption .cap{ color:var(--ink); }
.gallery figcaption .date{ color:var(--muted); white-space:nowrap; }
@media (max-width:640px){ .gallery{ grid-template-columns:1fr; gap:2rem; } }
.empty{ font-size:.85rem; color:var(--faint); padding:2rem 0; }

/* ---- certificate / recognition note (bottom of writing) ----------------- */
.award{ border-top:1px solid var(--line); margin-top:.5rem; padding:1.5rem 0 0; font-size:.84rem; color:var(--muted); }
.award a{ color:var(--accent); }

/* ---- reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion:reduce){
  *{ transition:none !important; }
}
