/* ──────────────────────────────────────────────────────────────────
   sketch.css — landing-page styles for index.html

   Goal: "very html energy" with the carved table borders chaski uses
   on the rest of the site. Mostly default-browser typography with
   carved <th>/<td>s holding the structured content.

   Self-contained: index.html does NOT load style.css or projects.css.
   The vars below mirror style.css so the carve-in cells look identical.
   ────────────────────────────────────────────────────────────── */

:root {
  /* palette — matches style.css exactly so carved borders read the same */
  --brown: hsl(100, 6.4%, 90%);
  --lighter: rgba(255, 255, 255, 0.25);
  --little-lighter: rgba(255, 255, 255, 0.05);
  --little-darker: hsla(0, 0%, 0%, 0.05);
  --darker: rgba(0, 0, 0, 0.25);
  --lot-darkwr: rgba(0, 0, 0, 0.8);
  --accent: var(--brown);
  --highlight: #ffe947;

  --radius: 0.15rem;
  --single: 1px solid;

  /* single font for the entire page */
  --sans: Arial, Helvetica, sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--brown);
  color: var(--lot-darkwr);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
}

body {
  padding: 0.75rem 0.75rem 3rem 0.75rem;
  position: relative;
}

/* ── default-browser-flavored layout ─────────────────────── */
main, header, footer {
  margin-inline: auto;
  max-width: 54rem;
  width: 100%;
}

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

a,
a:visited {
  color: var(--lot-darkwr);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover,
a:focus-visible {
  font-style: italic;
  text-decoration: none;
}

::selection { background: var(--highlight); color: var(--lot-darkwr); }

/* hr left in place for accessibility but visually minimal — tables touch
   so we don't actually use <hr>s anymore in index.html. */
hr {
  border: none;
  border-top: 1px solid var(--darker);
  margin: 0;
}


/* ── header / hero (intentionally bare) ───────────────────
   Two-column-ish flex layout: big <h1> on the left, bio in
   a column to its right, and the links row spans full width
   below both. Bio wraps within its own column, never under
   the headline. */
header.hero {
  padding: 2rem 0.5rem 1rem 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 1rem;
  row-gap: 0.4rem;
}

header.hero h1 {
  margin: 0;
  font-weight: bold;
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  flex: 0 0 auto;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius);
  /* clean yellow halo, in the same spirit as html.energy's join buttons */
  box-shadow: 0 0 28px 4px rgba(255, 233, 71, 0.6);
  transition: box-shadow 0.4s ease;
}

header.hero h1:hover {
  box-shadow: 0 0 48px 8px rgba(255, 233, 71, 0.95);
}

header.hero .intro-text {
  flex: 1 1 18rem;
  margin: 0;
  transform: translateY(0.35rem);
}

header.hero .links {
  flex: 1 1 100%;
  margin: 0.6rem 0 0 0;
  text-align: right;
}

header.hero .links a {
  margin-left: 0.6rem;
}


/* ── tables (carved cells, like the rest of the site) ─────
   Tables stack flush — no margin between them — so they read
   as one continuous block of carved cells. Each table's thead
   acts as the section label. */
table.works-table,
.exp-group table {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

/* offset the very first table from the intro a bit so it doesn't crowd */
.tables-stack {
  margin-top: 0.75rem;
}

table.works-table th,
table.works-table td,
.exp-group table th,
.exp-group table td {
  vertical-align: top;
  text-align: left;
  padding: 0.3rem 0.3rem;
  background-color: var(--little-darker);
  border-top: var(--single) var(--darker);
  border-left: var(--single) var(--darker);
  border-bottom: var(--single) var(--lighter);
  border-right: var(--single) var(--lighter);
  border-radius: var(--radius);
  overflow-wrap: break-word;
  word-break: break-word;
}

table.works-table th,
.exp-group table th {
  text-transform: lowercase;
  font-size: 0.75rem;
  font-weight: normal;
  letter-spacing: 0.05em;
  color: rgba(0, 0, 0, 0.5);
  text-align: left;
}

/* column widths: title / year / desc */
table.works-table .col-title { width: 22%; }
table.works-table .col-year  { width: 5rem; }
table.works-table .col-desc  { width: auto; }

/* experience tables (no title-bold treatment, just title/year cols) */
.exp-group table .col-title { width: 78%; }
.exp-group table .col-year  { width: 22%; text-align: right; }


/* ── cell content treatments ─────────────────────────────── */
.work-title {
  font-weight: bold;
  cursor: pointer;
}

.work-title.no-images {
  cursor: default;
}

.work-title:hover:not(.no-images) {
  font-style: italic;
  background: var(--highlight);
}

.work-year {
  font-weight: normal;
}

.work-desc p,
.work-desc small {
  margin: 0 0 0.4rem 0;
  display: block;
}

.work-desc .role {
  font-style: italic;
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.55);
  margin-top: 0.3rem;
  display: block;
}

.work-desc .visit-link {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
}

.work-desc .visit-link::after { content: " ↗"; }


/* ── sprinkled, draggable gallery images ─────────────────────
   Each gallery=TRUE image is dropped at an absolute position on the
   page (relative to <body>) with a slight random rotation. They sit
   above the page content.
   Click-without-drag opens them in the modal. */
.floating-img {
  position: absolute;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 1;
  background: var(--brown);
  border: 1px solid var(--darker);
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.2s, opacity 0.2s;
  touch-action: none;
}

.floating-img:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  opacity: 1;
}

.floating-img:active {
  cursor: grabbing;
  z-index: 10;
}

/* When an image lands overlapping the main text column we fade it back
   so the text underneath stays legible. Hover restores full opacity. */
.floating-img.over-text {
  opacity: 0.7;
}


/* ── inline image strip inside description cell ──────────── */
.entry-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding: 0;
}

.entry-images img {
  height: 100px;
  width: auto;
  cursor: pointer;
  background: var(--brown);
  border: 1px solid var(--darker);
  transition: transform 0.2s;
}

.entry-images img:hover {
  transform: translateY(-2px);
}


/* ── experience: grouped subsections (no h3, thead labels them) ── */
.exp-group {
  margin: 0;
}


/* ── modal: kept simple ──────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: hsla(100, 6.4%, 90%, 0.94);
  overflow-y: auto;
}

.modal-content {
  position: relative;
  margin: 5vh auto;
  padding: 2rem;
  width: 88%;
  max-width: 56rem;
  background-color: var(--little-darker);
  border-top: var(--single) var(--darker);
  border-left: var(--single) var(--darker);
  border-bottom: var(--single) var(--lighter);
  border-right: var(--single) var(--lighter);
  border-radius: var(--radius);
}

.modal-image {
  max-height: 70vh;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 0 auto 1rem auto;
  display: block;
  object-fit: contain;
}

.modal-image:not([src]),
.modal-image[src=""] { display: none; }

.modal-text { font-size: 0.95rem; }

.modal-text h3 {
  font-weight: bold;
  font-size: 1.4rem;
  margin: 0 0 0.5rem 0;
}

.modal-text small,
.modal-text .role,
.modal-text .date {
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.55);
  font-style: italic;
  display: block;
  margin: 0.25rem 0;
}

.modal-text .visit-button {
  display: inline-block;
  font-size: 0.8rem;
  background-color: var(--little-lighter);
  border-top: var(--single) var(--lighter);
  border-left: var(--single) var(--lighter);
  border-bottom: var(--single) var(--darker);
  border-right: var(--single) var(--darker);
  border-radius: var(--radius);
  padding: 0.25rem 0.6rem;
  text-decoration: none;
  margin-top: 0.5rem;
}

.modal-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.modal-thumb {
  width: 90px;
  height: 90px;
  object-fit: contain;
  cursor: pointer;
  background: var(--brown);
  border: 1px solid var(--darker);
  opacity: 0.65;
  transition: opacity 0.15s, box-shadow 0.15s;
}

.modal-thumb:hover {
  opacity: 1;
}

.modal-thumb.active {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--highlight);
}

.modal-embed {
  width: 100%;
  height: 380px;
  border: 1px solid var(--darker);
  margin-top: 1rem;
}

.close {
  position: absolute;
  top: 0.4rem;
  right: 0.8rem;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 1001;
}


/* ── footer ──────────────────────────────────────────────── */
footer {
  margin-top: 3rem;
  padding: 1.5rem 0.5rem 0.5rem 0.5rem;
  text-align: center;
}

footer img {
  max-width: 80px;
  margin: 0 auto;
  display: block;
}

footer p {
  font-size: 0.85rem;
  margin: 0.4rem 0;
  color: rgba(0, 0, 0, 0.6);
}

footer .updated {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.45);
}


/* ── responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  table.works-table { table-layout: auto; }
  table.works-table .col-title { width: auto; }
  table.works-table .col-year  { width: 4rem; }
  .entry-images img { height: 80px; }
}
