/* Nyle Faridi — site styles
   Breakpoints (same as the original): desktop >= 1200px, tablet 810–1199px, phone < 810px */

:root {
  --black: #000;
  --white: #fff;
  --grey-text: #86868b;
  --label: #f7f7f7;
  --divider: #e5e5ea;
  --hairline: #e8e8e8;
  --panel: #eaeaea;
  --link: #09f;
  --note: #ffe390;
  --select: #06d;
  --red: #fd5d5c;
  --yellow: #fac900;
  --green: #34c75a;
  --glass: rgba(255, 255, 255, 0.1);
  --glass-edge: rgba(255, 255, 255, 0.2);

  --font: "Inter", "Inter Placeholder", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Inter Display", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display-features: "blwf" on, "cv09" on, "cv03" on, "cv04" on, "cv11" on;

  /* Spring (bounce 0.2, duration 0.4s) sampled into a linear() curve */
  --spring: cubic-bezier(0.25, 1.1, 0.5, 1);
  --spring-duration: 0.4s;

  /* Rounded corners use a superellipse where supported, like the original */
  --se: 0.752;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.0459, 0.1535, 0.2882, 0.4276, 0.558, 0.672, 0.7668, 0.8423, 0.9, 0.9425, 0.9723, 0.9922, 1.0045, 1.0114, 1.0145, 1.0151, 1.0142, 1.0125, 1.0104, 1.0083, 1.0063, 1.0047, 1.0033, 1.0022, 1.0014, 1.0008, 1.0004, 1.0001);
  }
}
@supports (corner-shape: superellipse(1.5)) {
  :root { --se: 1; }
  .se { corner-shape: superellipse(1.5); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.04em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
p, h1, h2 { margin: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ============================================================
   HOME — the desktop
   ============================================================ */

body.home { background: var(--black); overflow: hidden; }

.screen {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: clip;
}

.wallpaper,
.wallpaper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.wallpaper img { object-fit: cover; object-position: center; }

.shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.4;
  background: linear-gradient(rgba(84, 84, 84, 0) 0%, #000 100%);
  pointer-events: none;
}

/* ---------- Desktop icons ---------- */

.icons { position: absolute; inset: 0; z-index: 2; }

.icon {
  position: absolute;
  left: calc(var(--x) * 1px);
  top: calc(var(--y) * 1px);
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  outline: none;
}
.icon img { -webkit-user-drag: none; pointer-events: none; }

.icon-frame {
  position: relative;
  padding: 12px;
  border-radius: 8px;
  background-color: transparent;
  transition: background-color var(--spring-duration) var(--spring);
}
.icon-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: inherit;
  pointer-events: none;
  transition: border-color var(--spring-duration) var(--spring);
}

.icon-img {
  position: relative;
  width: 80px;
  aspect-ratio: var(--ratio);
  border-radius: calc(8px * var(--se));
  box-shadow: rgba(0, 0, 0, 0.08) 0 1px 6px 0;
}
.icon-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.icon-img::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--glass-edge);
  border-radius: inherit;
  pointer-events: none;
}

.icon-label {
  display: flex;
  padding: 0;
  border-radius: 4px;
  background-color: rgba(0, 102, 221, 0);
  transition: background-color var(--spring-duration) var(--spring), padding var(--spring-duration) var(--spring);
}
.icon-label span {
  color: var(--label);
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.04em;
  white-space: pre;
}

@media (min-width: 1200px) {
  .icon:hover .icon-frame,
  .icon:focus-visible .icon-frame { background-color: rgba(0, 0, 0, 0.16); }
  .icon:hover .icon-frame::after,
  .icon:focus-visible .icon-frame::after { border-color: var(--glass-edge); }
  .icon:hover .icon-label,
  .icon:focus-visible .icon-label { padding: 4px; background-color: var(--select); }
}

/* ---------- Dock ---------- */

.dock-wrap {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 64px;
  translate: -50% 0;
}
.dock {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background-color: var(--glass);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  border-radius: calc(24px * var(--se));
}
.dock::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--glass-edge);
  border-radius: inherit;
  pointer-events: none;
}
.dock-item {
  position: relative;
  display: block;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: calc(16px * var(--se));
  cursor: pointer;
}
.dock-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  -webkit-user-drag: none;
}
.dock-divider {
  flex: none;
  width: 1px;
  height: 48px;
  background-color: var(--divider);
  border-radius: 64px;
}
.tooltip {
  position: absolute;
  left: 50%;
  top: -44px;
  translate: -50% 0;
  display: flex;
  padding: 6px 12px;
  background-color: var(--white);
  border-radius: 64px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  color: var(--black);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: -0.04em;
  transition: opacity 0.2s ease;
}
.tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 21px;
  width: 24px;
  height: 16px;
  translate: -50% 0;
  rotate: 180deg;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Cpath d='M10.488 3.746c.798-.921 2.226-.921 3.024 0L17.196 8l2.598 3c1.017 1.174.183 3-1.37 3H5.576c-1.553 0-2.387-1.826-1.37-3L6.804 8z' fill='%23fff'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
@media (hover: hover) {
  .dock-item:hover .tooltip,
  .dock-item:focus-visible .tooltip { opacity: 1; }
}

/* ---------- Windows ---------- */

.win-pos {
  position: fixed;
  display: none;
  user-select: none;
  -webkit-user-select: none;
}
.win-pos.is-open { display: block; }
.win-pos.is-draggable { cursor: grab; touch-action: none; }
.win-pos.is-draggable.is-pressed { cursor: grabbing; }
.win-pos img { -webkit-user-drag: none; }
.is-dragging iframe { pointer-events: none; }

#about-window { z-index: 3; top: 50%; left: 182px; translate: 0 -50%; }
#notes-window { z-index: 4; top: 43%; left: 61%; translate: -50% -50%; }

.win {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--white);
  border-radius: 24px;
  overflow: clip;
  will-change: transform;
  color: var(--black);
}
.win-scroll {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: auto;
}
.win-nav {
  position: sticky;
  top: 0;
  z-index: 1;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--white);
}
.lights { display: flex; gap: 8px; cursor: pointer; }
.light { width: 12px; height: 12px; border-radius: 64px; }
.light.red { background-color: var(--red); }
.light.yellow { background-color: var(--yellow); }
.light.green { background-color: var(--green); }
.win-title { color: var(--grey-text); }

.win-close {
  display: none;
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background-color: var(--white);
  border-radius: 128px;
}
.win-close::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--divider);
  border-radius: inherit;
}
.win-close svg { width: 24px; height: 24px; }

/* About me */
#about-window .win { width: 480px; height: 444px; }
#about-window .win-nav { height: 40px; padding: 14px; }
.about-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px;
}
.h2 {
  font-family: var(--font-display);
  font-feature-settings: var(--display-features);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.about-intro { display: flex; align-items: flex-end; gap: 24px; }
.about-photo {
  position: relative;
  flex: none;
  width: 128px;
  border-radius: 16px;
  overflow: clip;
}
.about-photo img { width: 100%; height: auto; border-radius: inherit; }
.about-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--hairline);
  border-radius: inherit;
  pointer-events: none;
}
.about-facts {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fact {
  display: flex;
  gap: 10px;
  white-space: nowrap;
  overflow: clip;
  box-shadow: inset 0 -1px 0 var(--hairline);
}
.fact-key { font-family: var(--font-mono); letter-spacing: 0; text-transform: uppercase; }
.fact-value { color: var(--grey-text); }
.fact-value a { color: var(--link); }
.about-bio {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background-color: var(--panel);
  border-radius: 8px;
}
.about-bio p + p,
.note-body p + p { margin-top: 1.4em; }
.about-location { display: flex; flex-direction: column; gap: 12px; }
.strong { font-weight: 600; }
.about-map {
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
}
.about-map iframe { display: block; width: 100%; height: 100%; border: 0; }
.contact-btn {
  align-self: flex-end;
  display: flex;
  padding: 8px 12px;
  background-color: var(--panel);
  border-radius: 8px;
  color: var(--black);
}

/* Notes */
#notes-window .win { width: 720px; height: 560px; }
#notes-window .win-nav { height: 42px; padding: 10px; }
.notes-content { display: flex; flex-direction: row; }
.notes-list {
  flex: none;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}
.note-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background-color: var(--note);
  border-radius: calc(16px * var(--se));
  cursor: pointer;
  min-width: 0;
}
.note-meta { display: flex; gap: 6px; white-space: nowrap; min-width: 0; }
.note-meta .preview { color: var(--grey-text); overflow: clip; text-overflow: clip; min-width: 0; }
.notes-body {
  flex: none;
  width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  box-shadow: inset 1px 0 0 var(--divider);
}
.note {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.note-date { color: var(--grey-text); text-align: center; }

/* Project windows (same content as the project pages, in a window) */
.project-window { top: 50%; left: 50%; translate: -50% -50%; }
.project-window .win { width: 720px; height: min(640px, calc(100vh - 120px)); }
.project-window .win-nav { height: 42px; padding: 10px; }
.project-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  padding: 16px 24px 40px;
  user-select: text;
  -webkit-user-select: text;
}
.project-content .h1 { font-size: 40px; }
.project-content .next-card { height: 240px; }
.is-draggable .win-nav { touch-action: none; }

/* ---------- Tablet & phone: home-screen layout ---------- */

@media (max-width: 1199.98px) {
  .screen {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  .icons {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 110.4px;
    gap: 24px 16px;
    width: 480px;
  }
  .icon {
    position: relative;
    left: auto;
    top: auto;
    translate: none;
    order: var(--order);
    width: 100%;
  }
  .icon-frame { padding: 0; }
  .icon-frame::after { display: none; }
  .icon-img { width: 80px; height: 80px; aspect-ratio: auto; border-radius: calc(24px * var(--se)); }

  .dock-wrap { bottom: 40px; }

  #about-window,
  #notes-window { top: 50%; left: 50%; translate: -50% -50%; }
  #about-window .win { width: 360px; height: 560px; }
  #notes-window .win { width: 390px; height: 560px; }
  .project-window .win { width: 600px; }
  .project-window .win-nav { height: 60px; padding: 10px; }

  .lights, .win-title { display: none; }
  .win-close { display: flex; }
  .win-nav { justify-content: flex-end; box-shadow: inset 0 -1px 0 var(--hairline); }
  #about-window .win-nav { height: 68px; padding: 14px; }
  #notes-window .win-nav { height: 60px; padding: 10px; }

  .contact-btn { align-self: flex-start; }

  .notes-content { flex-direction: column; }
  .notes-list { width: 100%; }
  .notes-body { width: 100%; }
}

@media (max-width: 809.98px) {
  .icons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px 16px;
    width: 100%;
  }
  #about-window,
  #notes-window,
  .project-window { width: 90%; }
  #about-window .win,
  #notes-window .win,
  .project-window .win { width: 100%; }
  .project-window .win { height: min(560px, calc(100vh - 200px)); }
  .project-content { padding: 16px 16px 32px; }
  .project-content .h1 { font-size: 32px; }
  .project-content .next-card { height: 180px; }
}

/* ============================================================
   PROJECT PAGES
   ============================================================ */

body.work { background-color: var(--white); color: var(--black); }

.work-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 24px 140px;
  overflow: clip;
}
.work-col {
  width: 100%;
  max-width: 748px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}
.back-btn {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--white);
  border-radius: 128px;
}
.back-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--divider);
  border-radius: inherit;
}
.back-btn svg { width: 24px; height: 24px; }

.work-intro { width: 100%; display: flex; flex-direction: column; gap: 40px; }
.work-heading { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.h1 {
  font-family: var(--font-display);
  font-feature-settings: var(--display-features);
  font-size: 48px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.04em;
  white-space: pre-wrap;
  word-break: break-word;
}
.work-desc {
  color: var(--grey-text);
  text-wrap: balance; /* line breaks in the description collapse into one paragraph, like the original */
}
.work-meta {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(50px, 1fr));
  gap: 24px;
}
.meta-item { display: flex; flex-direction: column; gap: 4px; }
.meta-item .value { color: var(--grey-text); }

.work-media {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ratio);
  border-radius: calc(16px * var(--se));
  overflow: clip;
}
.work-media img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.yt {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background-color: #000;
}
.yt img,
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt img { object-fit: cover; }
.yt-play {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 68px;
  height: 48px;
}
.yt-play svg { width: 100%; height: 100%; display: block; }

.next { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.next-item { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.next-card {
  display: block;
  width: 100%;
  height: 320px;
  border-radius: calc(24px * var(--se));
  overflow: clip;
  transition: opacity var(--spring-duration) var(--spring);
}
.next-card img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.next-card:hover { opacity: 0.7; }

@media (max-width: 809.98px) {
  .work-page { padding: 80px 16px 140px; }
  .work-heading { order: 1; }
  .work-meta { order: 0; grid-template-columns: minmax(50px, 1fr); }
}

/* 404 */
.notfound {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
}
.notfound p { color: var(--grey-text); }
.notfound a { color: var(--link); }
