/* ============================================================
   styles.css — Portfolio of Si Thu Aung Kyaw Htwe ("Sam")
   ------------------------------------------------------------
   Purpose: all styling for the single-page portfolio site.
   Design source: design_handoff_portfolio_site/README.md
   ("cinematic dusk" theme — dark, cool, blue-graded to match
   the owner's photography). Values are copied verbatim from
   the handoff; do not tweak without checking the README.
   ============================================================ */

/* ---------- Design tokens (README "Design Tokens") ---------- */
:root {
  --bg: #141b21;              /* page background */
  --bg-raised: #1c252c;       /* featured card / safari body */
  --bg-panel: #10161b;        /* contact panel */
  --bg-chrome: #242e36;       /* safari window title bar */
  --text: #e3eaef;            /* primary text / headings */
  --text-bright: #f2f6f8;     /* brightest (contact h2, hovers) */
  --text-body: #a9b6be;       /* body copy */
  --text-secondary: #8b98a1;  /* secondary */
  --text-muted: #75838d;      /* muted / labels */
  --border: #2a343c;          /* subtle borders */
  --border-strong: #39454e;   /* stronger borders */
  --border-hover: #6b7d8a;    /* card border on hover */
  --accent: #8fb8d8;          /* steel-blue links/icons/email */
  --accent-hover: #b8d4ea;    /* link hover */
  --serif-display: "Libre Caslon Display", serif;
  --serif-text: "Libre Caslon Text", serif;
  --sans: "Libre Franklin", system-ui, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1); /* shared easing for hovers + reveals */
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
/* Anchor targets sit below the 90px sticky nav */
section[id], main[id] { scroll-margin-top: 90px; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img { display: block; }

/* Scroll-reveal: elements start hidden + shifted, JS adds .on
   when >=12% intersects the viewport (see script.js) */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
[data-reveal].on { opacity: 1; transform: none; }

/* ---------- Liquid-glass surface ----------
   Used on ALL pills and buttons site-wide (README spec). */
.glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.22),
              inset 0 -1px 1px rgba(0, 0, 0, 0.3),
              0 6px 20px rgba(0, 0, 0, 0.35);
  border-radius: 999px;
}
/* Interactive glass (buttons/links) brightens on hover */
a.glass:hover, button.glass:hover {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3),
              inset 0 -1px 1px rgba(0, 0, 0, 0.3),
              0 10px 28px rgba(0, 0, 0, 0.5);
}

/* Glass CTA buttons (hero "Get in touch" / "My Resume") */
.btn {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  padding: 12px 26px;
  cursor: pointer;
  font-family: var(--sans);
}
.btn:hover { color: var(--text); }

/* ---------- Sticky nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 16px 6vw;
  background: rgba(20, 27, 33, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.nav-wordmark {
  font-family: var(--serif-display);
  font-size: 20px;
  color: var(--text);
}
.nav-wordmark:hover { color: var(--text); }
.nav-links {
  display: flex;
  gap: 8px; /* tighter: the links carry their own pill padding */
  flex-wrap: wrap;
  margin-left: auto;
  align-items: baseline;
}
/* Links are padded pills at rest (invisible) so the glass highlight
   can appear on hover without any layout shift */
.nav-link {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color .25s, background .25s, border-color .25s, box-shadow .25s;
}
.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.22),
              inset 0 -1px 1px rgba(0, 0, 0, 0.3),
              0 6px 20px rgba(0, 0, 0, 0.35);
}
.nav-contact {
  color: var(--text);
  padding: 6px 16px;
  /* restore the glass border that .nav-link's transparent one overrides */
  border-color: rgba(255, 255, 255, 0.16);
}
.nav-contact:hover { color: var(--text); }

/* ---------- Page shell ---------- */
.content {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px 20px;
}

/* Section header row: h2 + 1px rule filling remaining width */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 44px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 44px);
  color: var(--text);
  text-wrap: balance;
}
.section-head .rule { flex: 1; height: 1px; background: var(--border); align-self: center; }

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  align-items: center;
  padding: 80px 0 72px;
}
.hero-text {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.hero-badge {
  align-self: flex-start;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  padding: 6px 14px;
}
.hero h1 {
  margin: 0;
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(48px, 7.5vw, 88px);
  line-height: 1.05;
  color: var(--text);
  text-wrap: balance;
}
/* The ":)" reads upright: rotated 90° so it looks like a face.
   JS swaps its text to ";)" for 200ms every 1600ms (the wink). */
.hero-face {
  display: inline-block;
  transform: rotate(90deg);
  white-space: nowrap;
  font-variant-ligatures: none;
  margin-left: 0.35em;
}
.hero-subtitle {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.hero-intro {
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-body);
  max-width: 520px;
  text-wrap: pretty;
}
.hero-currently {
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 14px;
  color: var(--text-muted);
}
.hero-currently .label { letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; }
.hero-currently .value { color: var(--text-body); }
.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
}
.hero-photo { flex: 0 1 340px; min-width: 260px; }
.hero-photo-frame { position: relative; }
.hero-photo-frame img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: 2px;
}
/* Inset 1px white frame 14px inside the photo */
.hero-photo-frame::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  pointer-events: none;
  border-radius: 1px;
}

/* ---------- Coursework strip ---------- */
.coursework {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid var(--text); /* bright top rule per handoff */
  border-bottom: 1px solid var(--border);
  padding: 26px 4px;
  margin-bottom: 96px;
}
.coursework-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}
.coursework-label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 8px;
}
.coursework .pill {
  font-size: 13px;
  color: var(--text-body);
  padding: 3px 12px;
}

/* ---------- Experience ---------- */
#experience { margin-bottom: 110px; }
.job {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 12px 40px;
  padding: 30px 4px;
  border-bottom: 1px solid var(--border);
}
.job-side { display: flex; flex-direction: column; gap: 8px; }
.job-meta { font-size: 13px; color: var(--text-muted); }
.job-dates { font-variant-numeric: tabular-nums; }
.job-main { display: flex; flex-direction: column; gap: 8px; }
.job-title {
  margin: 0;
  font-family: var(--serif-text);
  font-weight: 700;
  font-size: 21px;
  color: var(--text);
}
.job-org {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}
.job-points {
  margin: 6px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.job-points li {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-body);
  text-wrap: pretty;
}
/* The "30,000+" figure renders bold and enlarged */
.big-stat { font-size: 1.35em; font-weight: 700; color: var(--text); }

/* Mini Safari-window preview (clickable link to the live site) */
.safari {
  display: block;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-raised);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform .3s var(--ease-out), border-color .3s;
}
.safari:hover { transform: translateY(-3px); border-color: var(--border-hover); }
.safari-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: var(--bg-chrome);
  border-bottom: 1px solid var(--border-strong);
}
.safari-light { width: 8px; height: 8px; border-radius: 50%; }
.safari-light.red { background: #ff5f57; }
.safari-light.yellow { background: #febc2e; }
.safari-light.green { background: #28c840; }
.safari-url {
  flex: 1;
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  background: var(--bg-raised);
  border-radius: 999px;
  padding: 2px 10px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.safari-shot { display: block; height: 110px; }
.safari-shot img { width: 100%; height: 100%; object-fit: cover; }
/* Variant for project screenshots: the window grows with the image's
   natural aspect ratio instead of cropping to a fixed height */
.safari-auto .safari-shot { height: auto; }
.safari-auto .safari-shot img { height: auto; object-fit: unset; }
/* Featured Okiro window: hide the left 5% and bottom 10% of the
   screenshot. The shot area's aspect ratio is the visible region of
   the 1600×853 image (95% × 90% → 1520×768); the image renders
   oversized (100/0.95) and shifted left so the left strip falls
   outside, and the fixed-ratio container clips the bottom. */
.featured-shot .safari-shot {
  aspect-ratio: 1520 / 768;
  overflow: hidden;
}
.featured-shot .safari-shot img {
  width: 105.26%;
  height: auto;
  margin-left: -5.26%;
  object-fit: unset;
}

/* ---------- Projects ---------- */
#projects { margin-bottom: 110px; }
.featured {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  background: var(--bg-raised);
  border-radius: 10px; /* rounder than the handoff's 3px, per owner */
  padding: clamp(24px, 4vw, 48px);
  margin-bottom: 28px;
}
.featured-text {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}
.featured h3 {
  margin: 0;
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 38px);
  color: var(--text);
}
.featured p {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-body);
  text-wrap: pretty;
}
.tech-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.tech-pill {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  padding: 4px 12px;
}
.featured-link {
  align-self: flex-start;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  border-bottom: 1px solid var(--text);
  padding-bottom: 2px;
}
.featured-link:hover { color: var(--accent-hover); }
/* Wider basis than the original 300px slot: the landscape Safari
   window needs the room; centered beside the text column */
.featured-shot { flex: 0 1 400px; min-width: 260px; align-self: center; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.project-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px; /* rounder than the handoff's 3px, per owner */
  padding: 30px;
  transition: transform .3s var(--ease-out), border-color .3s;
}
.project-card:hover { border-color: var(--border-hover); transform: translateY(-4px); }
.project-card .safari { margin-bottom: 4px; }
.project-card .eyebrow { color: var(--text-muted); }
.project-card h3 {
  margin: 0;
  font-family: var(--serif-text);
  font-weight: 700;
  font-size: 22px;
  color: var(--text);
}
.project-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-body);
  text-wrap: pretty;
}
.project-card .tech-pills { margin-top: auto; }
.project-card .tech-pill { letter-spacing: normal; }
.project-link {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}
.project-link:hover { color: var(--accent-hover); }

/* ---------- Photography ---------- */
#gallery { margin-bottom: 110px; }
#gallery .section-head { margin-bottom: 16px; }
.gallery-intro {
  margin: 0 0 40px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-body);
  max-width: 560px;
  text-wrap: pretty;
}
/* Masonry layout (petermckinnon.com/places style): CSS columns show
   each photo uncropped at its natural aspect ratio, mixed orientations
   flowing down the columns with 16px gutters. No JS needed. */
.gallery-masonry {
  columns: 3;
  column-gap: 16px;
}
.gallery-masonry img {
  width: 100%;
  height: auto; /* natural aspect ratio — never cropped */
  transition: opacity .3s var(--ease-out);
}
/* Tiles are links that open the lightbox; hint with a zoom cursor,
   subtle dim on hover (Squarespace-style gallery hover) */
.gallery-link {
  display: block;
  cursor: zoom-in;
  break-inside: avoid;       /* never split a photo across columns */
  margin-bottom: 16px;       /* vertical gutter to match column-gap */
}
.gallery-link:hover img { opacity: 0.82; }
@media (max-width: 1000px) { .gallery-masonry { columns: 2; } }
@media (max-width: 700px)  { .gallery-masonry { columns: 1; } }

/* ---------- Photo lightbox ----------
   Shows a gallery photo uncropped at its full size, over the same
   blurred backdrop as the resume modal. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 9, 12, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 16px;
  display: none; /* toggled to flex by script.js */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.lightbox.open { display: flex; }
.lightbox-toolbar {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}
.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 110px); /* leave room for the toolbar */
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  cursor: default;
}

/* ---------- Skills ---------- */
#skills { margin-bottom: 110px; }
.skill-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 8px 40px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--border);
}
.skill-label {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.skill-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.skill-pill {
  font-size: 13.5px;
  color: var(--text-body);
  padding: 4px 13px;
}

/* ---------- Contact ---------- */
#contact {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px; /* matches the project cards' rounder corners */
  padding: clamp(36px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: flex-start;
}
#contact .eyebrow { color: var(--text-secondary); }
#contact h2 {
  margin: 0;
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(28px, 4.5vw, 48px);
  line-height: 1.15;
  color: var(--text-bright);
  max-width: 640px;
  text-wrap: balance;
}
.contact-email {
  font-family: var(--serif-text);
  font-size: clamp(18px, 3vw, 26px);
  color: var(--accent);
  border-bottom: 1px solid rgba(143, 184, 216, 0.5);
  padding-bottom: 2px;
}
.contact-email:hover { color: var(--text-bright); }
.contact-links {
  display: flex;
  gap: 12px 28px;
  flex-wrap: wrap;
  align-items: baseline;
  margin-top: 8px;
}
.contact-phone {
  font-size: 15px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--accent);
}
.icon-btn:hover { color: var(--text-bright); background: rgba(255, 255, 255, 0.15); }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px 4px 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.footer .place { font-family: var(--serif-text); font-style: italic; }
.footer .top-link {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.footer .top-link:hover { color: var(--text); }

/* ---------- Resume viewer modal ----------
   Full-screen scrollable overlay; the "paper" mimics a classic
   print resume and stays light regardless of the site theme. */
.resume-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 9, 12, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-y: auto;
  padding: 40px 16px;
  display: none; /* toggled to flex by script.js */
  flex-direction: column;
  align-items: center;
}
.resume-overlay.open { display: flex; }
.resume-toolbar {
  width: min(820px, 100%);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}
.resume-btn {
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  padding: 9px 20px;
}
.resume-paper {
  width: min(820px, 100%);
  box-sizing: border-box;
  background: #fdfdfb;
  color: #1a1a1a;
  border-radius: 2px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  padding: clamp(28px, 6vw, 64px);
  font-family: var(--sans);
  cursor: default;
}
.resume-head {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1.5px solid #1a1a1a;
  padding-bottom: 18px;
  margin-bottom: 22px;
}
.resume-head h2 {
  margin: 0;
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(24px, 4vw, 34px);
  color: #1a1a1a;
}
.resume-head p { margin: 0; font-size: 13px; color: #444; }
.resume-section-title {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1a1a1a;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
}
.resume-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.resume-row strong { font-size: 15px; }
.resume-row .meta { font-size: 14px; color: #444; }
.resume-row.sub { font-size: 14px; color: #444; font-style: italic; }
.resume-block { margin-bottom: 20px; }
.resume-jobs { display: flex; flex-direction: column; gap: 16px; }
.resume-projects { display: flex; flex-direction: column; gap: 12px; }
.resume-paper ul {
  margin: 6px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.resume-paper ul li { font-size: 14px; line-height: 1.5; color: #222; }
.resume-project p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: #222; }
.resume-skills { display: flex; flex-direction: column; gap: 4px; }
.resume-skills p { margin: 0; font-size: 14px; color: #222; }

/* ---------- Mobile ----------
   The prototype relies on flex/grid wrap; the only rigid grids
   are the two-column experience/skills rows, so stack those on
   narrow screens. */
@media (max-width: 560px) {
  .job, .skill-row { grid-template-columns: 1fr; }
  .safari { max-width: 320px; }
}
